Hi,
I require a trigger that dumps the updated row into a txt file.
I am trying to achieve this using XP_CMDSHELL and bcp
The @bcp_command works fine if i run it thru DOS. But whenever triggers submits the BCP operation time outs. Also i have tried submitting different command , they all work fine accept the one i need.
Can some one please tell me why its timing out.
I require a trigger that dumps the updated row into a txt file.
I am trying to achieve this using XP_CMDSHELL and bcp
Code:
ALTER TRIGGER Dump_text ON dbo.XXXX AFTER INSERT,UPDATE AS declare @bcp_command varchar(300) BEGIN -- SET NOCOUNT ON added to prevent extra result sets from SET NOCOUNT ON; SELECT @bcp_command = 'bcp "SELECT * FROM DSeries..ESP_XXXX WHERE identifier='''+identifier+'''" queryout c:\gaurav.txt -c -t -UAAA -P BBBB"' FROM inserted [B]--SELECT @bcp_command = 'MD TEST'[/B] EXEC master..xp_cmdshell @bcp_command END GO
Can some one please tell me why its timing out.
Comment