General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Check record and insert
in SP, i would like to "check the record to see whether prefix" ABC" doesn't exist or not"
Parameter @prefix
if not exist
insert myNumber(prefix, number) values ("ABC",1000)
if exist
update myNumber set number = number+1 where prefix ="ABC"
How should I write it in SP ??
Thanks a lot
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only