sql server - how to set rowcount to zero in SQL -


anyone have idea how set rowcount 0 again in sql.

i have used rowcount fetch number of records inserted in insert statement. have use rowcount again find rows updated. trying reset rowcount again zero.

code :

insert table ......  insert statistics (id,inserted_records ) values (1,@@rowcount)  

---some operations--

update table ....  update statistics set updated_records=@@rowcount id= 

information rowcount here:

http://technet.microsoft.com/en-us//library/ms187316.aspx

statements such use, set , deallocate cursor, close cursor, begin transaction or commit transaction reset rowcount value 0

so maybe can put statements transaction, better isolated against each other.

and can send request not update anything, update mytable set x=1 0=1;


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -