
Signature
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
SQL Server has its default data file location, by default, it is "C:\Program
Files\Microsoft SQL Server\[MSSQL.1]2]...\MSSQL\Data". So, if you create new
database, the db's *.mdf/*.ldf file will be created there. You can change
the default data file location by using SSMS easily. However, if you attach
*.mdf file to SQL Server, the data file stays where it was after attaching.
I am not sure what you did, but if the *.mdf file cannot be deleted/copied,
then the data file must belong to an existing database and still in use. As
I said, you can use SSMS to find out a database' data is stored in which
location. I'd never simply stop SQL Server service and delete *.mdf file
without doing this check first.
> Norman,
>
[quoted text clipped - 14 lines]
>
> Thanks.
Jonathan Wood - 15 Apr 2008 02:52 GMT
Yes, what you describe is correct. I can verify this is the case. But I'm
still at a loss as to how to change it.
I backed up the databases I want to change. But if I select New Database in
SSMS, I don't see an option to read from a backup. And if I select Restore,
I went in to options and changed the database name but it still restores to
the original location.
Can't someone tell me how to make this database behave as though I just
created it through SQL Server, using the default database file location?
Thanks.

Signature
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
> SQL Server has its default data file location, by default, it is
> "C:\Program Files\Microsoft SQL Server\[MSSQL.1]2]...\MSSQL\Data". So, if
[quoted text clipped - 27 lines]
>>
>> Thanks.