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
 SQL Server Development (2000)
 how to call a procedure in update statement

Author  Topic 

dasu
Posting Yak Master

104 Posts

Posted - 2004-11-26 : 02:38:03
i have following situation

i need to call a stored procedure for each and every record of t_cbs_rqst table while updating t_cbs_rqst table.
iam sending u the model
so please suggest me the solution

stored procedure:

CREATE PROC CALLING @A INT OUTPUT
AS
SET @A=1

update statement :
here in calling stored procedure we need to pass the record as input parameter and rqst_cd is out put parameter

declare
@a int
UPDATE T_CBS_RQST
SET rqst_cd=exec CALLING @a output

dsdeming

479 Posts

Posted - 2004-11-29 : 08:51:54
If you can write CALLING as a user-defined function, you can call the function in an update statement.

UPDATE T_CBS_RQST
SET rqst_cd = CALLING( @a )

Dennis
Go to Top of Page
   

- Advertisement -