Created
January 5, 2011 15:42
-
-
Save phpleo/766472 to your computer and use it in GitHub Desktop.
Insertar un registro si no existe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- http://stackoverflow.com/questions/639854/tsql-check-if-a-row-exists-otherwise-insert | |
| IF NOT EXISTS (SELECT * FROM Bookings WHERE FLightID = @Id) | |
| BEGIN | |
| --UPDATE HERE | |
| END | |
| ELSE | |
| BEGIN | |
| -- INSERT HERE | |
| END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment