Wednesday, June 15, 2011
You can attach just the MDF file in SQL Server to move a database
Moving a database in SQL Server can be done by:
Offlining the database
Copying the MDF file
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
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment