Sunday, February 26, 2012

Go Through Each Row in Trigger

I was wondering if there was a go through each row in a updated/deleted table in a trigger. I have several booleans in a table and I want a final "complete" boolean to be updated depending on the values of the other booleans. Any easier way to do this?

Quote:

Originally Posted by nycninja

I was wondering if there was a go through each row in a updated/deleted table in a trigger. I have several booleans in a table and I want a final "complete" boolean to be updated depending on the values of the other booleans. Any easier way to do this?


Hi you can open a sql cursor from inserted tables or deleted table that contains the data you have inserted deleted or updated.

After you open a cursor you can loop wile cursor goto eof like a ado recordset cursor.

Look cursor transact-sql statement.

No comments:

Post a Comment