August 15, 2006 at 10:29 am
Hi all - i'm running this stored procedure to restore a DB and i get a funky error message about an unclosed quotation mark (where?!!??), can anyone help? Thank you kindly!
--CREATE PROCEDURE dbo.sp_SQLZIP_Restore_Corp_UTE_from_CorpProd
--AS
execute sp_sqlzip_restore_mt @dbname='Corporate_User_Testing'
,@reptfile='F:\SQLZIP_Backup\Corp_Prod\Corporate_User_Testing_Restore.report'
,@parts=4
,@bkupfile1='F:\SQLZIP_Backup\Corp_Prod\Corporate_Production_SQLZIP_1.zbak'
,@bkupfile2='F:\SQLZIP_Backup\Corp_Prod\Corporate_Production_SQLZIP_2.zbak'
,@bkupfile3='F:\SQLZIP_Backup\Corp_Prod\Corporate_Production_SQLZIP_3.zbak'
,@bkupfile4='F:\SQLZIP_Backup\Corp_Prod\Corporate_Production_SQLZIP_4.zbak'
,@timeout='10'
,@options='replace,
move ''CorpProd_Data1'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Primary.mdf'',
move ''CorpProd_Data2'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Data1.ndf'',
move ''CorpProd_Data3'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Data2.ndf'',
move ''CorpProd_Data4'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Data3.ndf'',
move ''Lic_Liab_Pgm_Assmt_Arch'' to ''F:\MSSQL\Data\Corporate_User_Testing\Lic_Liab_Pgm_Assmt_Arch_Data.NDF'',
move ''Lic_Liab_Pgm_Assmt'' to ''F:\MSSQL\Data\Corporate_User_Testing\Lic_Liab_Pgm_Assmt_Data.NDF'',
move ''CorpProd_Log1'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log1.ldf'',
move ''CorpProd_Log2'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log2.ldf'',
move ''CorpProd_Log3'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log3.ldf'',
move ''CorpProd_Log4'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log4.ldf'',
move ''CorpProd_Log5'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log5.ldf'' 'GO
Server: Msg 105, Level 15, State 1, Line 10
Unclosed quotation mark before the character string 'E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing'.
Server: Msg 170, Level 15, State 1, Line 10
Line 10: Incorrect syntax near 'E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing'.
Msg 12, Level 1, State 12
Timeout expired before SQLZIP Mutex:SQLZIP_Corporate_User_Testing was destroyed.
Server: Msg 50000, Level 16, State 1, Procedure sp_sqlzip_restore_mt, Line 151
Please review the Report file for errors.
August 15, 2006 at 1:18 pm
possible problems:
Quoted identifiers could be messing you up.
SET QUOTED_IDENTIFIER OFF
It could also be getting messed up because the final 'GO' is not on its own line.
You also have an unclosed quotey mark on this line:
,@options='replace,
You can't have a multi-line character constant in SQL...
August 15, 2006 at 3:21 pm
First, you can have a multiline constant, try this and see:
declare @options nvarchar(4000)
set
@options='replace,
move ''CorpProd_Data1'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Primary.mdf'',
move ''CorpProd_Data2'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Data1.ndf'',
move ''CorpProd_Data3'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Data2.ndf'',
move ''CorpProd_Data4'' to ''F:\MSSQL\Data\Corporate_User_Testing\Corporate_User_Testing_Data3.ndf'',
move ''Lic_Liab_Pgm_Assmt_Arch'' to ''F:\MSSQL\Data\Corporate_User_Testing\Lic_Liab_Pgm_Assmt_Arch_Data.NDF'',
move ''Lic_Liab_Pgm_Assmt'' to ''F:\MSSQL\Data\Corporate_User_Testing\Lic_Liab_Pgm_Assmt_Data.NDF'',
move ''CorpProd_Log1'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log1.ldf'',
move ''CorpProd_Log2'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log2.ldf'',
move ''CorpProd_Log3'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log3.ldf'',
move ''CorpProd_Log4'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log4.ldf'',
move ''CorpProd_Log5'' to ''E:\MSSQL\Logs\Corporate_User_Testing\Corporate_User_Testing_log5.ldf'' '
select @options
Looking at the error message, there may be a problem in the stored procedure. How big can the @option string in the stored procedure be? Is the string you are passing longer than allowed?
August 15, 2006 at 3:30 pm
Hi Lynn, good point - the @options varchar(255). Will look into it, thanks for your help!
August 15, 2006 at 3:55 pm
I come up with 1152 characters in your option string.
August 15, 2006 at 4:29 pm
Wow. Thanks!
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply