locked
Northwind and Pubs databases

    Question

  • Am trying to find where to get a copy of the Northwind / Pubs SQL databases.  Have found the scripts, but can't seem to make them work properly.  Have been able to find a copy of the access version, but am wanting to get into SQL.
    Any help??
    Wednesday, November 02, 2005 9:59 PM

Answers

  • Once you have the scripts you can use the SQL Express Utility tool that was just released on MSDN Donwloads (SQLExpress Utility). With the tool you can connect to the database server, create a database then run the sql script to create the database.

    Open the command prompt and navergate to the location of the SSEUtil tool and run the following commands:

     sseutil -c
    CREATE DATABASE <DatabaseName>
    go
    use <DatabaseName>
    !load <SQLScript>.sql
    go
    quit

    then at the command prompt,

    sseutil -d <DatabaseName>

    This should create the MDF file that you can use inside your applications. The file will be located here C:\Documents and Settings\<your username>\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS, You will need to copy this to the directory inside your application.
    Thursday, November 03, 2005 12:01 AM

All replies

  • You can use the osql utility to install them

    OSql -SServerName -E -iinstnwnd.sql

    OSql -SServerName -E -iinstpubs.sql

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_north_2ch1.asp

    Wednesday, November 02, 2005 11:54 PM
  • Once you have the scripts you can use the SQL Express Utility tool that was just released on MSDN Donwloads (SQLExpress Utility). With the tool you can connect to the database server, create a database then run the sql script to create the database.

    Open the command prompt and navergate to the location of the SSEUtil tool and run the following commands:

     sseutil -c
    CREATE DATABASE <DatabaseName>
    go
    use <DatabaseName>
    !load <SQLScript>.sql
    go
    quit

    then at the command prompt,

    sseutil -d <DatabaseName>

    This should create the MDF file that you can use inside your applications. The file will be located here C:\Documents and Settings\<your username>\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS, You will need to copy this to the directory inside your application.
    Thursday, November 03, 2005 12:01 AM
  • Thanks a bunch guys.  I had actually tried the osql utility, but couldn't get it accomplished.  I'll see if I can get it done with this info.
    Thanks again.
    Thursday, November 03, 2005 3:28 AM