January 31, 2019 at 1:16 am
I have a database whose name is Backup.
When I am running backup maintenance plan first time its failing and I have applied for retry in job ,and for next run its getting successful.
I want to know the reason.
Thanks
January 31, 2019 at 1:20 am
What error message are you getting if you check the history of the job?
Thanks
January 31, 2019 at 1:40 am
Sorry its Update statistics operation not backup operation:
Error:
If Object_..." failed with the following error: "156 Incorrect syntax near the keyword 'BACKUP'.
156 Incorrect syntax near the keyword 'BACKUP'.
156 Incorrect syntax near the keyword 'BACKUP'.
Thanks
January 31, 2019 at 1:47 am
forsqlserver - Thursday, January 31, 2019 1:40 AMSorry its Update statistics operation not backup operation:Error:
If Object_..." failed with the following error: "156 Incorrect syntax near the keyword 'BACKUP'.
156 Incorrect syntax near the keyword 'BACKUP'.
156 Incorrect syntax near the keyword 'BACKUP'.
It must be doing a backup if it's got the keyword 'BACKUP'. Have you tried running it as a SQL Agent job to check if it fails?
Thanks
January 31, 2019 at 1:57 am
What's the statement your using? BACKUP is a reserved word in SQL Server, so it's a poor choice for an object's name, in truth. The errors suggests you aren't quoting the objects name (hence why "incorrect syntax near the keyword 'BACKUP'"). This, of course, is a guess. We have a but a sliver of a piece of the pie at the moment.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
January 31, 2019 at 7:05 am
Sounds like Rob Volk's awesome presentation, Revenge, The SQL.
Anyway, you need brackets on your database names in the code. It'll have to go into the backup script for everything.
Strong piece of advice. Never use reserved words, special characters, or emojis, as object names within SQL Server.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 31, 2019 at 8:41 pm
Thanks all but its created by client mistakenly.I want to know how update stats is failing in first run and executing successfully in second run?
Thanks
February 1, 2019 at 1:53 am
forsqlserver - Thursday, January 31, 2019 8:41 PMThanks all but its created by client mistakenly.I want to know how update stats is failing in first run and executing successfully in second run?
We still that SQL please.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply