Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I use an IF
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
00761098
Message ID:
00761105
Vues:
25
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform