RE: sql trigger that exports data
From: JoeDz (JoeDz_at_discussions.microsoft.com)
Date: 09/28/04
- Next message: Dennis Forbes: "Re: multiple date params"
- Previous message: Aaron [SQL Server MVP]: "Re: multiple date params"
- In reply to: JoeDz: "sql trigger that exports data"
- Next in thread: Nigel Rivett: "RE: sql trigger that exports data"
- Reply: Nigel Rivett: "RE: sql trigger that exports data"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 13:29:05 -0700
Thanks for the examples Nigel;
I am trying the bcp example in a trigger, it almost works:
CREATE TRIGGER sensorData_insert ON sensorData
AFTER INSERT
AS
BEGIN
exec master..xp_cmdshell 'bcp database..table out c:\triggerOut.bcp -S
server -U user-P password-c'
END;
One problem: when I insert a record, the table appears to be locked; the
triggerOut.bcp file is created, but empty. After a while I stop the server.
Then the triggerOut.bcp file is populated. Any idea what I am missing, seems
like the trigger is waiting for something to complete. Also, during this
'locked' period, I can not query the table.
Thanks for your help.
"JoeDz" wrote:
> I would like to create an insert trigger which will export the newly inserted
> record to a file in C:\Temp.
> Is there a way I can export data from within a trigger?
> Thanks.
- Next message: Dennis Forbes: "Re: multiple date params"
- Previous message: Aaron [SQL Server MVP]: "Re: multiple date params"
- In reply to: JoeDz: "sql trigger that exports data"
- Next in thread: Nigel Rivett: "RE: sql trigger that exports data"
- Reply: Nigel Rivett: "RE: sql trigger that exports data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|