Mark Rohrbeck
asked on
Moving WSUS Database SBS2011
Hello,
I tried following these directions --> http://www.blackmanticore.com/caa80f452a8fb0337dfc80875e79dddc
To move my susdb.mdf and SUSDB_log.ldf from my C:\WSUS\SUSDB\UpdateServic esDbFiles folder to P:\WSUS\Database as my C:\ is running low on space and the database is around 13GB. All went well up until the point I need to mount the database back. When I try run the command
sqlcmd -E -S np:\\.\pipe\MSSQL$MICROSOF T##SSEE\sq l\query -Q "sp_attach_db @dbname=N'SUSDB',\
@filename1=N'P:\WSUS\Datab ase\SUSDB. mdf',\
@filename2=D'P:\WSUS\Datab ase\SUSDB_ log.ldf"
I get this:
C:\Windows\system32>sqlcmd -E -S np:\\.\pipe\MSSQL$MICROSOF T##SSEE\sq l\query -Q
"sp_attach_db @dbname=N'SUSDB',\
Msg 105, Level 15, State 1, Server SERVERNAME\MICROSOFT##SSEE , Line 1
Unclosed quotation mark after the character string 'sp_attach_db @dbname=N'SUSDB
','.
Msg 102, Level 15, State 1, Server SERVERNAME\MICROSOFT##SSEE , Line 1
Incorrect syntax near 'sp_attach_db @dbname=N'SUSDB','.
C:\Windows\system32> @filename1=N'P:\WSUS\Datab ase\SUSDB. mdf',\
'filename1' is not recognized as an internal or external command,
operable program or batch file.
C:\Windows\system32> @filename2=D'P:\WSUS\Datab ase\SUSDB_ log.ldf"
I tried connecting with management studio express to try attach the database from there but it can no longer connect to MICROSOFT##SSEE. What is the correct systax I should use or how can i get this database re attached?
FYI, my OS is SBS2011
I tried following these directions --> http://www.blackmanticore.com/caa80f452a8fb0337dfc80875e79dddc
To move my susdb.mdf and SUSDB_log.ldf from my C:\WSUS\SUSDB\UpdateServic
sqlcmd -E -S np:\\.\pipe\MSSQL$MICROSOF
@filename1=N'P:\WSUS\Datab
@filename2=D'P:\WSUS\Datab
I get this:
C:\Windows\system32>sqlcmd
"sp_attach_db @dbname=N'SUSDB',\
Msg 105, Level 15, State 1, Server SERVERNAME\MICROSOFT##SSEE
Unclosed quotation mark after the character string 'sp_attach_db @dbname=N'SUSDB
','.
Msg 102, Level 15, State 1, Server SERVERNAME\MICROSOFT##SSEE
Incorrect syntax near 'sp_attach_db @dbname=N'SUSDB','.
C:\Windows\system32> @filename1=N'P:\WSUS\Datab
'filename1' is not recognized as an internal or external command,
operable program or batch file.
C:\Windows\system32> @filename2=D'P:\WSUS\Datab
I tried connecting with management studio express to try attach the database from there but it can no longer connect to MICROSOFT##SSEE. What is the correct systax I should use or how can i get this database re attached?
FYI, my OS is SBS2011
ASKER
After running that I get the following:
C:\Windows\system32>sqlcmd -E -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -Q
"sp_attach_db @dbname=N'SUSDB',@filename1=N'P:\WSUS\Database\SUSDB.mdf',@filenam
e2=D'P:\WSUS\Database\SUSDB_log.ldf"
Msg 105, Level 15, State 1, Server CELERASERVER\MICROSOFT##SSEE, Line 1
Unclosed quotation mark after the character string 'P:\WSUS\Database\SUSDB_log.l
df
'.
C:\Windows\system32>
spotted it now, the unclosed quotation mark is at the end of the statement, right after susdb_log.ldf.
Added that now and the code is below, give it a try and let us know the results.
Added that now and the code is below, give it a try and let us know the results.
C:\Windows\system32>sqlcmd -E -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -Q
"sp_attach_db @dbname=N'SUSDB',@filename1=N'P:\WSUS\Database\SUSDB.mdf',@filenam
e2=D'P:\WSUS\Database\SUSDB_log.ldf'"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did the trick. You my friend are my hero. THANK YOU. Question... what do the "D" and "N" values represent?
There is nothing as D in SQL Server... it is syntactically wrong.
N means it is a NVARCHAR data type not a VARCHAR dataType. NVARCHAR datatype can hold charecter outside the normal ASCII range.
N means it is a NVARCHAR data type not a VARCHAR dataType. NVARCHAR datatype can hold charecter outside the normal ASCII range.
try this one,put them all in one line and it should work.
Open in new window