June 3, 2010 at 3:34 am
What I want to do is create some stored procedures where I pass e.g. a database name and use that in the stored procedure to generate the required SQL job / alert / backup devices etc.
For example, I want to
1 - pass a variable @name to a select statement to find a job id from sysjobs table.
2 - assign the job id to a variable.
3 - variable in create statement - eg and create alert statement to define the variable as the value for (in this example) the alert response job.
the problem is I get - variable .... not defined as a scalar value.
I'm not sure why I get that error?
Is what I want to do possible?
_____________________________________________________________________________MCITP: Business Intelligence Developer (2005)
June 3, 2010 at 4:10 am
dave-dj (6/3/2010)
the problem is I get - variable .... not defined as a scalar value.
post your script
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
June 3, 2010 at 5:36 am
Job_ID is not an int. You have to use uniqueidentifier or char / varchar data types for your variable.
EDIT: And yes, what you want to do is possible. Just adjust your expectations of how to deal with the data type and your code should work.
June 3, 2010 at 8:05 am
guys,
thanks for posting - I think i've now found the cause of the problem which seemed related to how I set the variable.
_____________________________________________________________________________MCITP: Business Intelligence Developer (2005)
June 3, 2010 at 8:19 am
Glad we could help. Let us know if you need anything else.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply