PDA

View Full Version : MSSQL StoredProcedure - Moving a DB


ghell
02-21-2005, 08:36 PM
i found this article on moving a database:

http://support.microsoft.com/default.aspx?scid=kb;en-us;224071 (Moving user databases)

i have 2 databases on a server and i want to move them from a directory on C:\ where i have 300mb of space to one on E:\ where i have 30gb

however, i cant work out how to excecute these stored procedures, eg the only thing i can find would just excecute "sp_detach_db" without the
use master
go
sp_detach_db 'mydb'
gohow can i move these databases from say C:\dir\db\ to E:\db\ ?
can it be done in asp or what, it doesnt NEED to be asp but i read it could be done with the EXECUTE method when running an sql query, eg objConn.Execute("EXECUTE .....")

ghell
02-24-2005, 04:45 PM
nvm when my c drive got down to 170mb i just took a gamble and used backup/restore (even though i couldnt find any documentation on doing this safely)