Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2011-10-05 : 10:31:05
|
I have a nvarchar variable called batch_id, which was set earlier in my package.I want to call a Stoed Procedure via SQL task using this variable as a parameter to the SP. I have set up my SQL task as shown below. The task currently fails.Result Set: None (SP is designed to return nothing)Connection Type: valid/working SQL Con ManagerSQLSourceType: Direct InputParameter Mapping: variable name = user:batch_id, direction = input, data type = nvarchar, parameter name = @batch_id, parameter value = -1SQL Statement: exec dbo.stp_c_TES 'AA','BB', @batch_idgoexec dbo.stp_c_TES 'CC','DD', @batch_idThanks in advance! |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-06 : 09:03:20
|
make it like exec dbo.stp_c_TES 'AA','BB', ?goexec dbo.stp_c_TES 'CC','DD', ?and in parameter mappingParameter Mapping: variable name = user:batch_id, direction = input, data type = nvarchar, parameter name = @batch_id, parameter value = 0variable name = user:batch_id, direction = input, data type = nvarchar, parameter name = @batch_id, parameter value = 1------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2011-10-06 : 09:37:02
|
Thanks Vis, I can only get it to work when I comment out the 2nd call to the SP.exec dbo.stp_c_TES 'AA','BB', ?--go--exec dbo.stp_c_TES 'CC','DD', ?As soon as I introduce the 2nd call, the task blows up.Are you able to call 2 SP's from the same task? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-06 : 09:39:17
|
try putting them in separate execute sql------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2011-10-06 : 09:42:43
|
I could always break it into two separate SQL tasks if I had to... |
|
|
qman
Constraint Violating Yak Guru
442 Posts |
Posted - 2011-10-06 : 09:46:09
|
You typed faster than me.... LOL. |
|
|
|
|
|
|
|