help!!

  • I downloaded Northwind db and would like to attach it to my server. I am currently running MSDE. what osql command should I use to attach the database?

    MCP/MCSA


    MCP/MCSA

  • SQL BOL 2000:

    To attach a database

    Expand a server group, and then expand a server.

    Right-click Databases, and select All Tasks/Attach Database.

    Enter the name of the MDF (master data file) of the database to attach. If you are not sure where the file is located, click browse (...) to search. There can only be up to 16 file names specified. For more information, see sp_attach_db.

    To ensure that the specified MDF file is correct, click Verify. The Original File Name(s) column lists all the files in the database (data files and log files). The Current File(s) Location column lists the file names and paths. If Microsoft® SQL Server™ cannot find the files in the specified locations, the attach operation fails. The Current File(s) Location column can be edited, and the current location of the file must be in this column for the attach operation to work. For example, if you have changed the default location of the file before you detached it, you must specify the current location for the attach operation to be successful.

    In the Attach as box, enter the name of the database. The database name must not match any existing database names.

    Specify the database owner.

    Click OK. A database node for the newly attached database is created in the Database folder.

  • Oops this is through Enterprise Manager!

  • EXEC sp_attach_db @dbname = N'Northwind',

    @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\Northwind.mdf',

    @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\Northwind_log.ldf'

    Be sure to adjust the path and/or the physical file names involved.


    David R Buckingham, MCDBA,MCSA,MCP

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply