Transferring Databases/Paths

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

This is a bit of a beginner's question, I know, so bare with me.

Recently I upgraded to SQL Server 7.0. When I did this, I noticed that there was very little room left on the hard drive SQL was on, and attempted to move the current databases to a seperate drive. However, I haven't changed all of the path settings correctly, and SQL is still trying to read data, by default, from drive C, instead of drive D where I would like it to read from. I changed the master file path, error log path, and master log path.. what have I missed?

-- Anonymous, July 29, 1999

Answers

Allison,

I'd be happy to bare with you.

It seems that you have moved some files and have not told SQL Server their new location.

This is from the 7.0 verson of SQL Server Books Online article titled, "Attaching and Detaching Databases".

Because the primary file contains the information needed to find the other files comprising the database, it is necessary to specify [only] the location of the files that have changed location, for example, files originally located on the C:\Mssql7\Data subdirectory that are now located on the D:\Mssql7\Data subdirectory. _Any_ files that have changed location _must_ be specified. Otherwise, SQL Server will try to attach the files based on the file location information stored in the primary file. If the files have changed location, they will not be found, and the database will not be successfully attached.

If you still have (or can free up) enough room on the C: drive, I would try moving the databases/files back to the C: drive and specifying their location on the C: drive. If that works, I would then do the moves again and be careful to specify all the new locations completely.

Hope this helps,

Eric

-- Anonymous, July 29, 1999


Moderation questions? read the FAQ