sql - DELETE ... OUTPUT COUNT(DELETED.*) -
i want know how many rows removed in delete operation.
i took the microsoft example b is
delete sales.shoppingcartitem output deleted.* shoppingcartid = 20621; and tried modify return count of deleted records:
delete datacache output count(deleted.*) userid=@id but throws
exceptionmessage: "incorrect syntax near '*'." exceptiontype: "system.data.sqlclient.sqlexception" message: "error" so tried
delete datacache output count(deleted) userid=@id which throws
exceptionmessage: "invalid column name 'deleted'." exceptiontype: "system.data.sqlclient.sqlexception" message: "error" what did miss?
just run query , modified rows
delete datacache userid=@id select @@rowcount
Comments
Post a Comment