!!!!!!!!HOW DO YOU OPEN AN EXISTING DATABASE!!!!!!!

  • Ok I have to reinstall SQL Server on one of my servers and I am trying to open an existing Database file.  and it won't let me.

  • Hello John,

    Can you elaborate your scenario?

     


    Lucky

  • i saved my database files and logs and then reinstalled SQL Server on a different drive still on the same server and put the files back in the data folder but enterprise manager don't find them and they don't show up in the databse folder on enterprise manager

  • When you saved your files, what do you mean by saved?

    My guess is you have to re attache the mdf, and ldf files.

    use enterprise manager to attach, or use sp_attach in query analyzer

  • do you know what top put after the @ statement before the = ?

  • If I wanted to attach a database name Chicken what would be the statement

    sp_attach_db @Chicken = N' <Chicken, Server Name, Chicken Data>,

    @Chicken_Data = N'<Chicken_Data, nvarchar (260), Path Name

     

    thats what i have now but its not working it says Chicken is not a parameter for procedure sp_attach_db.

  • Refer to BOl for sp_attach_db syntax..

    http://msdn2.microsoft.com/en-us/library/ms179877.aspx

     

     

    -Krishnan

  • Here is an example of the sp_attach_db syntax from the SQL BOL.

     

    EXEC sp_attach_db @dbname = N'pubs',    @filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',    @filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'
     

  • Thanks everyone i got it

Viewing 9 posts - 1 through 8 (of 8 total)

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