SSTS Blog

Some news and tidbits that we share

You can attach just the MDF file in SQL Server to move a database

by SSTS
SSTS
Server Side Technology Solutions is a consulting firm that specializes in databa
User is currently offline
on Jun 15 in Blog 0 Comments
Moving a database in SQL Server can be done by:
  1. Offlining the database
  2. Copying the MDF file
  3. Attaching the datafile at the new server
You do this by  calling the sp_attach_single_file_db procedure
i.e.
exec sp_attach_single_file_db @dbname='MY_DB', @physname='H:\SQL2\MY_DB.mdf'
SQL Server will automatically create a new logfile... Moving a database in SQL Server can be done by:
  1. Offlining the database
  2. Copying the MDF file
  3. Attaching the datafile at the new server
You do this by  calling the sp_attach_single_file_db procedure
i.e.
exec sp_attach_single_file_db @dbname='MY_DB', @physname='H:\SQL2\MY_DB.mdf'
SQL Server will automatically create a new logfile

Read more http://billennis-ssts.blogspot.com/2011/06/you-can-attach-just-mdf-file-in-sql.html

Tags: Untagged
Hits: 15703

About the author

SSTS

Server Side Technology Solutions is a consulting firm that specializes in database design, development and support.

Comments

Please login first in order for you to submit comments