August 7, 2014 at 6:56 am
hi,
i have to find out the modified table and its column details .
ie,if we are executing a query.It will insert or update records .
i have to get tables and column (which column , table changed ,updated or inserted value,previous value in case of exiting record etc)
is there any sql script or tools or any feature available??
if Any method .. please let me know
thank you
August 7, 2014 at 7:18 am
sumith1andonly1 (8/7/2014)
hi,i have to find out the modified table and its column details .
ie,if we are executing a query.It will insert or update records .
i have to get tables and column (which column , table changed ,updated or inserted value,previous value in case of exiting record etc)
is there any sql script or tools or any feature available??
if Any method .. please let me know
thank you
Not quite sure what context you are looking for but perhaps a trigger? Or you might like into CDC (Change Data Capture).
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
August 7, 2014 at 10:12 am
Here are the options I know of for what you want to do and the SQL Server version(s) it will work on:
1. DDL Triggers - all versions
2. Stored Procedures that do all CRUD operations and do the logging as part of the procedure - all versions
3. Change Data Capture (CDC) - 2008 or later.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
August 7, 2014 at 10:24 pm
thank you
August 7, 2014 at 10:27 pm
Any tools available for this ?
August 8, 2014 at 6:40 am
sumith1andonly1 (8/7/2014)
Any tools available for this ?
Tools for which option?
I believe you can find some scripts in the scripts section of this site that will automatically generate audit triggers for all you tables.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply