Thursday, February 9, 2012

Attach/Detach database

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
AlHi
I would recommend that you do this from Query Analyser, there is no need to
create the database first.
http://support.microsoft.com/defaul...ben-us%3b224071
John
"vul" <aaa@.optonline.net> wrote in message
news:enYHb8trEHA.3900@.TK2MSFTNGP10.phx.gbl...
> 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
>|||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
"vul" <aaa@.optonline.net> wrote in message
news:enYHb8trEHA.3900@.TK2MSFTNGP10.phx.gbl...
>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
>

No comments:

Post a Comment