Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I use an IF
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
00761098
Message ID:
00761105
Views:
26
This message has been marked as the solution to the initial question of the thread.
>I want to write a stored procedure, and pass it several parameters. One of the parameters would be if it is an update or new record. Can I write a stored procedure that:
>
>if @tiAction=1
> * Code to Update
>else
> * Code to insert
>
>
>
>Thanks
>Kirk

Yes you can.
...
if @tiAction=1
  BEGIN
     * Code to Update
      ...
  END
else
  BEGIN
     * Code to insert
     ...
  END
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform