Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Display count of deleted rows?

Author  Topic 

taunt
Posting Yak Master

128 Posts

Posted - 2014-05-23 : 14:12:26
Hello I'm runnnf this query:

DELETE FROM SFdata
FROM Items
WHERE (Items.UseUpdate = '0')


What I'm trying to do is display a count of the rows deleted by that query. I'vd tried select count(*) with the above, but it errors out. How can I have is display the deleted rows as delcount?

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-23 : 14:19:54
DELETE FROM SFdata
FROM Items
WHERE (Items.UseUpdate = '0')

SELECT @@ROWCOUNT AS delcount

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -