Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Trigger to output data to a text file

Status
Not open for further replies.

trick1978

Technical User
May 23, 2006
1
GB
Dear all,

I need to monitor a particular table in my SQL database. I am therefore looking to create a trigger on this table on update/insert/delete. When an update occurs on this table I require all records where Field A is greater than Field B, to be output to a text file.

Can anyone recomend the best way of doing this or provide a breif example of the TSQL to create the trigger as I am having trouble doing this at the moment.

Any guidance would be much appreciated.
 
The way I proceed with this is
Create a trigger on Insert, Update and dealate to insert the pre and post values of Filed A and Filed B to a thried table. Then you can create a DTS pacakge to dump the data to a table daily or you can create as part of trigger, but its not recommended. DTS you can schedule to run periodically.


Dr.Sql
Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top