Groups | Blog | Home
all groups > sql server connect > october 2004 >

sql server connect : Attach/Detach database


vul
10/10/2004 11:37:53 AM
I need to copy my SQL Server 2000 database from my development machine to
the server of one of the client. By using Enterprise Manager I was going to
detach db from my server, create a database with the same name on a new
server, detach it, replace files on the new server with my copies and attach
both databases on both servers back.
Unfortunately my server displays Attach Database entry only in popup menu. I
have nothing to attach yet.
I did this operation several times and had no problem before. Probably I
detached some of the unimportant databases and forgot to attach it back.
How can I refresh (clean up whatever) Enterprise Manager memory about last
operation in order to have the ability to use Detach feature?
Thank you
Al

Dan Guzman
10/10/2004 11:44:57 AM
The detach option is context-sensitive so you need to first select the
desired database in the tree.

You should not create a new database before attaching. Detach the database
and copy the files to the new server. In the Attach database dialog,
specify the mdf file, click Verify and specify the desired database name in
the 'Attach As' box. You can change the locations of the other files in the
list, if needed.

You might also consider using the sp_attach_db and sp_detach_db stored
procedures. See the Books Online for more information.

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

John Bell
10/10/2004 5:36:56 PM
Hi

I would recommend that you do this from Query Analyser, there is no need to
create the database first.

http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b224071

John

[quoted text, click to view]

AddThis Social Bookmark Button