Showing posts with label dml. Show all posts
Showing posts with label dml. Show all posts

Monday, March 19, 2012

Auditing table data changes

Hi,

Is there any RDBMS concept ,If i do any DML operations in any of table i need to know how many rows are inserted/updated/deleted in particular table. I dont want write any trigger to get those information.

because the table count nearly 142.

Moving to Transact-SQL from SSIS.|||

Nope. Triggers are the only current method in 2005 and earlier.

You could pretty easily write a code generator using the system tables (sys.tables, sys.columns) once you determine how to do one of them, then just follow a common pattern.

|||

Yes..My last question. i have done work around solution.

just loading data into table using bulk insert concept. after that used substring function to fixed the problem.

Thanks - Phil Brammer.

Sunday, March 11, 2012

Auditing Status of a Trigger in SQL Server 2005

I need to know when a DML trigger changes state (from enabled to disabled, and disabled to enabled).

I **assume** this info is not in any of the standard SQL Server 2005 loags and find no entry relating to triggers being enabled/disabled.

Therefore I also *assume* the best way to do this is create a DDL Trigger and populate a table when a trigger status is changed.

Am I on the right track?

Has anyone done this? Code samples/links to solution?

Is there a simplier way <i'm all about simple>?

Thanks in advance.

Thats exactly the right direction, if you need a quikc sample for using DDL events, take a look at the DDL event definition in the BOL and perhpas at the slightly different samples on my website: http://sqlserver2005.de/articles/2/

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de