This project is read-only.

How do I use CodePlex to download samples and sample databases?

  • To download the entire set of SQL Server product samples, click on the releases tab for this portal project, then click on the appropriate installer for your computer.
  • To focus on samples for a particular technology on the appropriate Product or Community link in the sample table on the home portal page. After clicking on that link you can:
    • Download all the samples for that particular technology area by clicking on the Releases tab, then clicking on the desired release in the upper right hand "Releases" box if you want a different release than the one selected by default, then clicking on the appropriate installer for your computer.
    • Browse the source code without downloading by clicking on the Source Code, then keep clicking on the appropriate folder icons in the Browse column until you find the particular sample source code you wish.
    • File a bug or check the status of a bug by clicking on the Issue Tracker tab.
  • To view forum posts or create a new thread of forum posts about samples in either this portal project or a particular Product or Community project click on the Discussions tab in that project.

For more information about CodePlex, see CodePlex Documentation

I can't find the sample database installers. Where are they?

You can find them in the AdventureWorks Sample Databases project.

When I start the installer (MSI), I get: "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2738."

Error Code 2738 Large.png
  • This is a usually a sign that VB Script has been disabled in your o/s; it can usually be fixed by re-registering VB Script as follows:
  1. Open command window (CMD) as Administrator.
  2. cd %windir%\System32
  3. regsvr32 vbscript.dll

When I install the sample databases I get an error: "Error 1721. There is a problem with this Windows Installer package." Help!

  • This is typically caused by trying to use the SQL Server 2008 installers on a SQL Server 2005 instance. Be sure to download the correct installers for the version of SQL Server you are using. Try executing SELECT @@VERSION using SQL Server Management Studio or SQLCMD if you aren't sure. The SQL Server 2005 installers are available. See the directions above for how to use the Releases tab for every project (including the sample database project) to find the right version. By default SQL Server 2008 installers are shown, but you can select SQL Server 2005 installers if you wish. Alternatively, you can just find them here.

When I try to install CLR samples or the Storefront Sample I get an error: "Msg 15208, Level 16, State 1, Line 1 The certificate, asymmetric key, or private key file does not exist or has invalid format." Help!

  • Make sure you've created the sample key files. See the readme file for the sample you are trying to install for directions on where and how to create the sample key files.
  • Make sure the DLLs you compile are configured to be signed with the appropriate sample keys.
  • On Vista and newer OSes this is typically caused by a permissions issue. The service account SQL Server is running under does not have permission to access the DLLs. For SQL Server 2005 you can use the following procedure:
  • Use windows explorer and locate the folder c:\Microsoft SQL Server\90\Samples (or where ever you've installed the samples if you changed that location).
  • Click right on that folder.
  • Click on the security tab.
  • Click on the edit button.
  • Click on the add button.
  • In the “Object name to select” text box enter the MachineName\SQLServer2005MSSQLUser$MachineName$InstanceName group. For example, if my machine was named AdventureWorksServer with SQL Express installed the default way, the group would be named SQLServer2005MSSQLUser$AdventureWorksServer$SQLEXPRESS.
  • Click OK until all the dialogs are gone.

I think the CodePlex UI is hard to use!

  • It is true that it takes some getting used to, but we think the extra power and flexibility compared to the download center is worth it. If you have specific suggestions for how the CodePlex team could improve the user experience, we encourage you to click on the CodePlex project and file your suggestion using the Issue Tracker tab. If enough people in the community vote in favor of your suggestion it will be noticed by the team which maintains and improves

Where are the Notification Services samples?

  • Notification Services samples are not located in a technology specific project as Notification Services is deprecated in SQL Server 2005 and does not ship in SQL Server 2008 (some scenarios may be included in Reporting Services in a future release). However if you download all the SQL Server 2005 samples from here the Notification Services samples are included.

Last edited Feb 24, 2009 at 6:29 PM by ReedMe, version 13


BondRidhoo Mar 12, 2012 at 3:30 PM 
Is there a desktop app for the database?

ffalconz Apr 28, 2011 at 10:12 PM 
Can I use the AdventureWorks Database for commercial courses ?

ctatum Mar 29, 2010 at 8:30 PM 
I have XP and can't seem to get the first database to install. I getting this error.. I have followed all the pre-installation directions. What else do I need to do? Please help. I really would like to get started working on the exercises in the book.. Please..

Error: Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER1\MSSQL\DATA\Documents". Operating system error -2147024891: "0x80070005(Access is denied.)".
Installation Terminated
Finished installation of database AdventureWorks2008 on 3/29/2010 3:01 PM.
Please someone give me some help, I have called and asked everyone I know...

animalmother Oct 14, 2009 at 3:26 PM 
What the hell is wrong with this stupid package? Could you guys have made it harder to use?

The setup could not install the database automatically, I guess that's because I have a named instance and no default instance (while most packages out there will work by asking the user the name of the instance, hello?). Fine, I searched all over the installation directory to find the "Samples" in \Tools\Samples (do not confuse with \Samples).

Now there are four different folders.

AdventureWorks 2008 Analysis Services Project (I'm guessing this is the cube)
AdventureWorks 2008 Data Warehouse (I'm guessing this is the DW database for the cube)
AdventureWorks 2008 LT (no idea)
AdventureWorks 2008 OLTP (no idea)

In all four cases there isn't even a README.TXT. Have you ever realized this is a "standard" text file that comes with most packages... with install instructions? I guess we are downloading this package as a tutorial, as a way to learn SQL (the hard way!)

OK, so I'm trying to install that DW database. There's no database backup file but a bunch of CSV's. I'm wondering, do I have to create the database manually then import all the CSV's manually? Wow, there's an SQL script! Hey, they're comments in the header, woohoo!

* NOTE: These environtment variables are set by the installer package (MSI).
* In order to run this script manually, either set the environment variables,
* or uncomment the setvar statements and provide the necessary values if
* the defaults are not correct for your installation.
:setvar SqlSamplesDatabasePath "C:\Program Files\Microsoft Office Servers\12.0\Data\MSSQL.1\MSSQL\Data"
:setvar SqlSamplesSourceDataPath "C:\Program Files\Microsoft SQL Server\100\Tools\Samples\"

So I uncommented these two variables and put the actual folders. I try to run the script, and it gives me an error from setcmd. I realize I have to enable the SQLCMD feature, which I have no idea how. So I search on google and find out it's in the Query -> SQLCMD mode. Woohoo, this might actually work after all.

Guess what? Another error... it complains about filestream. Then I look over to the Codeplex forums and realize you have to enable Filestream and Text Full Search. (I guess the guys who made the package thought it was so obvious they didn't include any instructions about that...)

Here is how to enable Filestream (for really newbie people such as me!):

I go over to the FILESTREAM tab and guess what?

FILESTREAM is not supported on this instance of SQL Server. FILESTREAM is not supported on versions of SQL Server earlier than SQL SERVER 2008 (which we are using), or an instance of SQL Server running under WOW.

What is WOW? Surely it's not World of Warcraft. I found out on Google (not even on Microsoft's servers):

"The confusion is lifted when you discover that WOW refers specifically to running a lower-end platform of Windows on a higher-end platform. For example, the latest version of WOW is more fully and properly titled WOW64, meaning it allows you to run 32-bit software in a 64-bit environment. Without the latest version of WOW, you wouldn't be able to run SQL Server 2000 SP4 with full support on a x64 64-bit OS. Going back in time, the original version of WOW allowed you to run 16-bit applications on 32-bit Windows."

Thanks for seriously wasting my time with your half-baked (usually we're talking about a donkey) stupid tutorial package which I CANNOT USE because we are running SQL Server 32-bit on a 64-bit server. I guess the .BAK backup method was too boring for you guys so you made it impossible to install for some of us!

CC Oct 8, 2009 at 11:09 PM 
I'm running on Vista Home edition, SQL 2008 Server Evaluation copy. Full text search and filestream are enabled.
I've downloaded the 2008 sample databases.

When I install, the install says it exited prematurely, and having run a logged install it says:

Action start 22:54:46: CA_SetDatabaseInstanceName4Installation.
Action ended 22:54:47: CA_SetDatabaseInstanceName4Installation. Return value 3.
DEBUG: Error 2896: Executing action CA_SetDatabaseInstanceName4Installation failed.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2896. The arguments are: CA_SetDatabaseInstanceName4Installation, ,
Action ended 22:54:47: WelcomeDlg. Return value 3.
Action 22:54:47: FatalError.
Action start 22:54:47: FatalError.
Action 22:54:47: FatalError. Dialog created
Action ended 22:54:49: FatalError. Return value 2.
Action ended 22:54:49: INSTALL. Return value 3.

I have previously had SQL 2005 Express edition installed on the machine, so 2 instances are shown in the drop down list, however, I have uninstalled the older version before installing SQL 2008.

I then ran the install, and deselected the option to create the database, assuming that the database files would be installed, but there's no *.mdf /*.ldf installed, so the *.sql script fails. Am I doing something wrong ? where can I get these databases from?

Leamas Sep 7, 2009 at 11:22 AM 
Hi, I have also managed to load AdventureWorks before without problems, but having tried to reload the new version 'Refresh 1', I end up with a folder full of .csv files and no means or directions for attaching that to an SQL instance? I don't get any errors during the install but something is clearly missing. I can't find any .mdf or .bak files, where do I go from here?
Given that the majority of people trying to install these files will be newbies, there really needs to be better instructions.

tldev Aug 5, 2009 at 8:01 PM 
I followed the directions and upon confirming I am in compliance with the prerequisites I proceeded to run the installation.
After completing the installation I was attempting to use the sample code in Codeplex for SQL Server Analysis Services and discovered the Server Explorer in Visual Studio could not locate the databases so I checked SQL Management Studio and noticed that all the samples were installed under the Database Engine and not in Analysis Services. The files are in "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data" and I cannot Attach them because of some naming convention error "The specified database folder 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data' is not valid. It does not match the Analysis Services naming convention of 'ID.version.db'. (Microsoft.AnalysisServices)"
What actions should a poor bloke such as myself take at this bewildering juncture?

JoopD Feb 18, 2009 at 10:38 PM 
I do not understand where the AdventureWorks2008 database has gone, last time when i installed the codeplex adventureworks database, a database named "AdventureWorks2008" was made.
When i reinstalled the sample databases, it is gone! I'm reading a sql tutorial that uses the AdventureWorks2008 database extensively, so please anybody tell me where to get it?
Full text search and filestream are enabled.

landonmkelsey Dec 9, 2008 at 5:25 PM 
how can anybody make something so simple into a clusterflop!

I ran the adventureworks.msi and nothing showed up in my 2005 tables

The new php example doesn't work!

(1) <?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
// $server = 'LANDON\SQLEXPRESS';

$server = '(local)\sqlexpress';
$link = mssql_connect($server, 'sa', 'K^a_t^e_a_u_x_3141');

die('Something went wrong while connecting to MSSQL');

/* Specify the server and connection string attributes. */
$serverName = "(local)";
$connectionInfo = array( "Database"=>"AdventureWorks");

/* Connect using Windows Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));

/* Query SQL Server for the login of the user accessing the
database. */
$tsql = "SELECT CONVERT(varchar(32), SUSER_SNAME())";
$stmt = sqlsrv_query( $conn, $tsql);
if( $stmt === false )
echo "Error in executing query.</br>";
die( print_r( sqlsrv_errors(), true));

/* Retrieve and display the results of the query. */
$row = sqlsrv_fetch_array($stmt);
echo "User login: ".$row[0]."</br>";

/* Free statement and connection resources. */
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);

I have no trouble connecting with non-MS RDBs

hunterpaw Dec 4, 2008 at 2:54 AM 
I agree with dalek. This FAQ is practically useless to someone who is trying to learn about SQL Server Samples. It is mostly useless to me and I develop SQL Server and ASP.Net applications. A single page that gives basic information about SQL Server and the downloads that newbies can understand would be immensely helpful. If you already have such a page, why is it so hard to find? I don't have the time to go to all of the links listed to find out what I need to know.
Why are you not listening to the users? This quote is telling:
"I think the CodePlex UI is hard to use!
It is true that it takes some getting used to, but we think the extra power and flexibility compared to the download center is worth it. If you have specific suggestions for how the CodePlex team could improve the user experience, we encourage you to click on the CodePlex project and file your suggestion using the Issue Tracker tab. If enough people in the community vote in favor of your suggestion it will be noticed by the team which maintains and improves "
"If enough people in the community vote in favor of your suggestion "
You would have more people in the community if you listened to them! This is why I hate to have to use CodePlex, which is so sad because I think it can be so great but it is so frustrating.

jxs0900 Apr 23, 2008 at 7:48 PM 
I'm getting an error 1722 when I try to install the sample database.

dalek Jan 24, 2008 at 3:38 AM 
the directions for finding particular tutorial files are not hard to find - THEY ARE NOT POSTED! This is the most ridiculous tutorial I have ever seen.

bonniefe Dec 4, 2007 at 1:24 AM 
That is an excellent suggestion. I recommend filing a work item at Click on the Work Item tab and create a new work item. If people in the community vote for it then the CodePlex team will more likely take the time to implement your suggestion.

RickAlto Sep 5, 2007 at 5:23 PM 
Any way you could make your downloads more "download-manager" friendly? Perhaps put them on an actual FTP site?

I use GetRight to throttle my downloads so that other users here at work are minimally impacted by the traffic.