July 10, 2012 at 3:57 am
Hi,
I was executing following SQL Batch ,
"
Use FlexFamilyMembership
EXEC sp_resetstatus (‘FlexFamilyMembership’)
ALTER DATABASE FlexFamilyMembership SET EMERGENCY
DBCC checkdb (‘FlexFamilyMembership’)
ALTER DATABASE FlexFamilyMembership SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (‘FlexFamilyMembership’), (REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE FlexFamilyMembership SET MULTI_USER
"
This cant executed giving error;
Msg 102, Level 15, State 1, Line 2 Incorrect syntax near '‘'.
Please give solution
July 10, 2012 at 4:05 am
The problem is with the single-quoted parameters. Use PRINT @sqlcommand instead of EXEC(@sqlcommand) and examine the statement.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 10, 2012 at 4:09 am
you should execute in this way :
Use FlexFamilyMembership
EXEC sp_resetstatus 'FlexFamilyMembership'
ALTER DATABASE FlexFamilyMembership SET EMERGENCY
DBCC checkdb ('FlexFamilyMembership')
ALTER DATABASE FlexFamilyMembership SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('FlexFamilyMembership',REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE FlexFamilyMembership SET MULTI_USER
July 10, 2012 at 4:19 am
najeeb_kt2000 (7/10/2012)
DBCC CheckDB (‘FlexFamilyMembership’), (REPAIR_ALLOW_DATA_LOSS)
Wait... what???
Yo do realise that is going to cause data loss? No backups? No alternatives to throwing data away?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 10, 2012 at 4:32 am
This Sql give error
Msg 102, Level 15, State 1, Line 2 ,Incorrect syntax near '‘'.
why this problem.
July 10, 2012 at 4:38 am
Print instead of exec giving the error as follows'
Msg 102, Level 15, State 1, Line 2,
Incorrect syntax near '‘'.
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near '‘'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '‘'.
Msg 1038, Level 15, State 4, Line 12
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name.
Msg 105, Level 15, State 1, Line 13
Unclosed quotation mark after the character string ''.
July 10, 2012 at 4:44 am
najeeb_kt2000 (7/10/2012)
This Sql give errorMsg 102, Level 15, State 1, Line 2 ,Incorrect syntax near '‘'.
why this problem.
Please respond to Gail's post before we continue with correcting the syntax error.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply