March 14, 2012 at 9:44 am
Sure this is a simple, and probably stupid question but I need help with the following;
I run the following to show all jobs
use msdb
go
sp_help_job
This returns all jobs. one of the jobs includes single quotes. For example;
Daily 'full' backup
I then want to run;
use msdb
go
sp_help_job
@job_name = N'Daily 'full' backup',
@job_aspect = N'all'
However it failes due to the single quotes. If for example the job was called;
Daily full backup
The SQL executes correctly. I have managed to work around this by using @job_id instead of @job name but would like to understand why this didn't work, is there a reason or way to using single quotes.
March 14, 2012 at 9:48 am
As far as I know no not using single quotes - you need to use double quotes.
use msdb
go
sp_help_job
@job_name = N'Daily ''full'' backup',
@job_aspect = N'all'
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
March 14, 2012 at 9:54 am
Thanks, I thought I tried that, but obviously had a typing error somewhere. Just tried again and that worked. Told you it was a stupid question.
Thanks for the prompt reply.
March 14, 2012 at 9:56 am
Not a stupid question at all!
Your welcome
Andy
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy