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 2005 Forums
 Transact-SQL (2005)
 If statement under stored proc

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2008-01-25 : 15:24:18
I am confused how to write an IF within the stored procedure, i would like to add the following to an existing working stored procedure as an addon to the existing function:


if @LinkModuleName ='PF'
Update tab_JetPF set rm_sent = @Identity where PFID = @rm_sentPFid;

if @LinkModuleName ='PU'
Update tab_JetPU set rm_sent = @Identity where PUID = @rm_sentPFid;

Thank you very much for the information.

jdaman
Constraint Violating Yak Guru

354 Posts

Posted - 2008-01-25 : 15:33:29
if / else if / else
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2008-01-25 : 15:38:25
I would be tempted to skip the entire procedural aspect of the thing and have both updates sitting out there nice and pretty with a predicate on the @LinkModuleName.

Jay
to here knows when
Go to Top of Page
   

- Advertisement -