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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SP problem during runtime

Author  Topic 

sujosh
Yak Posting Veteran

55 Posts

Posted - 2002-01-24 : 11:50:06
I am executing the SP from a trigger. This is how I do it.

exec insert_doc_trans @table,@col_name,@old_value,@new_value,@doc_type,@last_upd_date,@key_col_vchar1,@key_col_vchar2,@key_col_vchar3,@key_col_dt1,@key_col_num1,@key_col_dec1


The datatypes of @key_col_num1,@key_col_dec1 are decimal(15,0) and decimal(10,3). Does decimal variables cant go in as null? What am I missing here. Not values will be populated at any given time. Therefore somewill go in as null. Now my question is why cant a deciaml column(s) be sent as null values through the SP? So I thought let me do a workaround by checking for null (of the deciaml column and setting those variables as 0) and still I am getting the same problem. Where am I going wrong?
When I update the table which has the trigger this is what I get.

"Procedure 'insert_doc_trans' expects parameter '@key_col_num1', which was not supplied."


Thanks

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-01-24 : 12:17:34
try running this from Query Analyser...and if it doesn't work there....then the problem isn't the fact that it is being called from a trigger.


it is good practice to code statements calling other SP's in the following manner...

exec sp_abc @parm1=@value1, @parm2=@value2, @parm3=@value3, @parm4=null, @parm5=@value5


you might try converting what you've got to something like the above and see if it improves things.

Go to Top of Page

sujosh
Yak Posting Veteran

55 Posts

Posted - 2002-01-24 : 12:32:23
Will try it thanks..

Go to Top of Page

sujosh
Yak Posting Veteran

55 Posts

Posted - 2002-01-24 : 12:33:48
The order in the SP was wrong. Thanks again

Go to Top of Page
   

- Advertisement -