Sql-server – How to move a database from one server to the other using SQL Server Management Studio

sql serversql-server-2008ssms

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

I was think to simply detach the database from my server using SQL Server Management Studio and move the .mdf and .ldf files to the new directory and attach it to the new server.

Can someone guide me please?

Best Answer

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.