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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 CURSOR - Not passing variables to stored proc

Author  Topic 

Chris_Kelley
Posting Yak Master

114 Posts

Posted - 2014-08-12 : 15:11:09
c

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-08-12 : 15:14:45
I don't see @STAT being set before you pass it to the stored procedure.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Chris_Kelley
Posting Yak Master

114 Posts

Posted - 2014-08-12 : 15:22:03
c
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-08-12 : 15:27:13
I don't see any other issues. You'll need to investigate the stored procedure. Try executing just the stored procedure with the data values from the first row in the temp table, meaning test without the cursor. You need to determine if the issue is with the cursor or the stored procedure. I typically will add PRINT statements when debugging. I would add it above the EXEC and print out each of the variables.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Chris_Kelley
Posting Yak Master

114 Posts

Posted - 2014-08-12 : 18:21:24
c
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-08-12 : 19:01:07


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Chris_Kelley
Posting Yak Master

114 Posts

Posted - 2014-11-11 : 19:34:09
c
Go to Top of Page
   

- Advertisement -