Take the 2-minute tour ×

I need to move a database, but I want to make sure I do it safely and with all triggers, store proc and functions.

I was think to simply detach the database from my server using MS-SQL-SMS and move the .mdf and .ldf to the new directory and attach it to the new server.

Can someone guide me please ?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

If you use "Detach/Attach" function you'll be able to transfert the database with all triggers and objects that are inside the DB. You must know that only the database will be tranfert. If you need to have all the logins for the old server, you can use this link from Microsoft. After you run the procedure, you can have some orphaned users. If you read carefully the Miscrosoft KB, you will find a link to solve this issue.

If you tranfer from 2005 to 2008 you must use this link to tranfer logins.

Hope this help you.

share|improve this answer
Thanks, it works perfectly ! –  Philippe Lavoie Jul 11 '11 at 15:55
You need to use that link to transfer logins to matter if you are staying on the same version or not. –  mrdenny Jul 11 '11 at 21:09
add comment

Your Answer


