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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write a trigger to creates text file with data on insert

Status
Not open for further replies.

chpnmurty

Programmer
Mar 12, 2001
1
IN
I have to create a trigger to generate a text file which should contains the data from the record inserted and some hardcoded strings.
 
Well this can be done with the an "Alert"
Open Enterprise Manager and your database then look under "SQL Server Agent" in the list.
Right click on the "Alerts" items and click "New alert" then give it a name, a severity and on the "Response" TAB you can "Execute" a JOB created to do what you want.
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
I would suggest that rather than writing to a text file each time, write to a "log" table. You can then search the log and do other manipulations, and print it using Query Analyzer or the client tool of your choice. A lot more flexible, reliable, and faster than trying to write to a text file each time. Robert Bradley
Got extra money lying around? Visit:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top