sql server (updating)
if i update one record in table ...after updating how can i ensure that the tab开发者_如何学JAVAle has only one affected record. Im using sql server 2005
Use @@ROWCOUNT
USE AdventureWorks;
GO
UPDATE HumanResources.Employee
SET Title = N'Executive'
WHERE NationalIDNumber = 123456789
IF @@ROWCOUNT = 0
PRINT 'Warning: No rows were updated';
GO
精彩评论