Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ruan4u
Posting Yak Master
132 Posts |
Posted - 2005-05-24 : 10:49:11
|
| When I am trying to attach a database stored on D:\backup it doesnt show D drive. It only C and E. Why would this be? |
|
|
SreenivasBora
Posting Yak Master
164 Posts |
Posted - 2005-05-24 : 14:57:33
|
| Hey,Check your drive partition. I feel your C drive is partitioned into D also and E is a separate drive.Use below script from Query analyzer you can get the same resultsEXEC sp_attach_single_file_db @dbname = 'TestDB', @filename1 = N'D:\backup\TestDB_data.mdf', @filename2 = N'D:\backup\TestDB_log.ldf'With RegardsSreenivas Reddy B |
 |
|
|
ruan4u
Posting Yak Master
132 Posts |
Posted - 2005-05-24 : 18:42:52
|
| and if i have to restore it from a .BAK file? |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-05-24 : 19:47:52
|
If the D: drive is a network drive, then it's not going to do you any good to specify D: if you are trying to automate this. You will need to use the network share names:EXEC sp_attach_single_file_db @dbname = 'TestDB', @filename1 = N'\\SERVER\server_share\backup\TestDB_data.mdf',@filename2 = N'\\SERVER\server_share\backup\TestDB_log.ldf'It will be the same thing for restores. (from books online):BACKUP DATABASE Northwind TO DISK = '\\SERVER\server_share\Northwind.bak'RESTORE FILELISTONLY FROM DISK = '\\SERVER\server_share\Northwind.bak'RESTORE DATABASE TestDB FROM DISK = '\\SERVER\server_share\Northwind.bak' WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf', MOVE 'Northwind_log' TO 'c:\test\testdb.ldf' MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|