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 |
|
braddoro
Starting Member
7 Posts |
Posted - 2002-07-30 : 16:57:16
|
| I am trying to restore a database using T-SQL and I can't seem to get the syntax right. I am trying to use the with move option but I seem to be misunderstanding something. Any help is appreciated.This command:RESTORE DATABASE CommonTables FROM DISK = '\\Server2\BACKUP\CommonTables\CommonTables_db_200207300030.BAK' WITH MOVE 'CommonTables_Data' TO '\\Server3\d$\MSSQL\Data\CommonTables.mdf', MOVE 'CommonTables_Log' TO '\\Server3\d$\MSSQL\Data\CommonTables.ldf'gets me this output:Server: Msg 5110, Level 16, State 2, Line 1File '\\Server3\d$\MSSQL\Data\CommonTables.mdf' is on a network device not supported for database files.Server: Msg 3156, Level 16, State 1, Line 1File 'CommonTables_Data' cannot be restored to '\\Server3\d$\MSSQL\Data\CommonTables.mdf'. Use WITH MOVE to identify a valid location for the file.Server: Msg 5110, Level 16, State 1, Line 1File '\\Server3\d$\MSSQL\Data\CommonTables.ldf' is on a network device not supported for database files.Server: Msg 3156, Level 16, State 1, Line 1File 'CommonTables_Log' cannot be restored to '\\Server3\d$\MSSQL\Data\CommonTables.ldf'. Use WITH MOVE to identify a valid location for the file.Server: Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.thanks |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-07-30 : 18:05:28
|
| From which server are you trying to do this ?Run it on Server3 and specify local NOT unc paths for the MOVE parameters.HTHJasper Smith |
 |
|
|
braddoro
Starting Member
7 Posts |
Posted - 2002-07-30 : 18:11:35
|
| I am running it from query analyzer logged into Server3 but not from the console of Server3. Is that the the same thing as far as the file system is concerned? |
 |
|
|
braddoro
Starting Member
7 Posts |
Posted - 2002-07-30 : 18:15:38
|
| You are the MAN!I changed it from UNC to a local path. Thanks alotThis is the working code:RESTORE DATABASE CommonTablesFROM DISK = '\\Server2\BACKUP\CommonTables\CommonTables_db_200207300030.BAK'WITH MOVE 'CommonTables_Data' TO 'd:\MSSQL\Data\CommonTables_Data.MDF',MOVE 'CommonTables_Log' TO 'd:\MSSQL\Data\CommonTables_Log.LDF' |
 |
|
|
|
|
|
|
|