Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of records in DELETED?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01520791
Message ID:
01520792
Views:
49
>Hi,
>
>When DELETE trigger is called, SQL Server creates table DELETED. I want to check that this table (DELETED) has only one record (in my business deleting more than one record indicates a problem). What is the syntax of checking for DELETED having only one record? Thank you.
if (select count(*) from Deleted) = 1
  -- We can proceed - only 1 record
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform