Does anyone know how to attach a database TO another server? I am currently writing an SP that will (hopefully) detach, move and re-attach a database from one server to another. The last bit is causing me problems though.
I can attach a database FROM another server by executing the following code.......but I can't for the life of me reverse the process.
DBCC TRACEON (1807)
execute master..sp_attach_db 'MPS_Client',
@filename1 = N'\\Server\Server_C\Directory\Data.mdf',
@filename2 = N'\\Server\Server_C\Directory\Log.ldf'
DBCC TRACEOFF (1807)
Any ideas would be appreciated
I can attach a database FROM another server by executing the following code.......but I can't for the life of me reverse the process.
DBCC TRACEON (1807)
execute master..sp_attach_db 'MPS_Client',
@filename1 = N'\\Server\Server_C\Directory\Data.mdf',
@filename2 = N'\\Server\Server_C\Directory\Log.ldf'
DBCC TRACEOFF (1807)
Any ideas would be appreciated