Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Move

Status
Not open for further replies.

cceng

IS-IT--Management
Joined
Aug 27, 2001
Messages
104
Location
US
I will be moving a few databases to a new SQl server. One issue I have is that the location of the database files on the current server is E: and where they will be on the new server is c:

When I detach and attach the database to the new server does it recognize the new location of the files?

I am using the command sp_detach and sp_attach to move the database.
 
You will have to specify the new location of the files once they have been moved and you use sp_attach_db.

Example:

EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\mssql7\data\pubs.mdf',
@filename2 = N'c:\mssql7\data\pubs_log.ldf'


Rick.

 
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top