November 2, 2004 at 11:01 am
hi every body
By using this triggers iam able to insert data in table
CREATE TRIGGER xyz
ON
zyx AFTER INSERT
AS
insert into zyx values( )
Like this i want write on Notepad by using trigger
November 3, 2004 at 7:49 am
Do you mean that you want to open notepad everytime the trigger fires and write something in notepad?
November 3, 2004 at 12:14 pm
FROM http://vyaskn.tripod.com/code/write_to_file.txt
CREATE PROC write_to_file
@msg VARCHAR(100),
@file VARCHAR(100),
@overwrite BIT = 0
AS
/*
Written by: Narayana Vyas Kondreddi
Date written: January 12th 2001
Purpose: To log messages to text files from stored procedures/triggers/sql scripts
Input parameters: message, file name, overwrite flag (1 to overwrite, 0 to append to file, 0 is the default)
Example: EXEC write_to_file 'Duplicates found','C:\logfile.txt',0
Tested on: SQL Server Version 7.0, 2000
Remarks: You should have permissions required through access file system through xp_cmdshell
See SQL Server Books Online for xp_cmdshell if you are having problems with this procedure
Email: answer_me@hotmail.com
Homepage: http://vyaskn.tripod.com
*/
BEGIN
SET NOCOUNT ON
DECLARE @execstr VARCHAR(255)
SET @execstr = RTRIM('echo ' + COALESCE(LTRIM(@msg),'-') + CASE WHEN (@overwrite = 1) THEN ' > ' ELSE ' >> ' END + RTRIM(@file))
EXEC master..xp_cmdshell @execstr
SET NOCOUNT OFF
END
November 4, 2004 at 6:54 am
Yes the same
rpl please
November 4, 2004 at 7:13 am
I don't understand what you are trying to accomplish, if you open notepad everytime the trigger fires it's gonna open notepad on the server (not the client's computer).
Why do you need to do this task (maybe we can offer a better solution)?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply