I've tried to run a console application in Server from "after insert trigger" in one of my tables in SQL Server 2000. I used the following line
Declare @Seq_NO bigint ;
SELECT @Seq_NO=i.Seq_No from inserted i
declare @CmdSQL varchar(1000)
set @CmdSQL = 'C:\temp\SendEmailConsole\SendScheduledEmail.exe' + cast(@Seq_NO as varchar(10))
exec master..xp_cmdshell @cmdSQL
which "C:\temp\SendEmailConsole" is a test location for my Application.
It works for other versions of SQL Server newer than 2000, I activated the command on them using this :
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC master..sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
My first question is why master..sp_configure 'xp_cmdshell', 1
is not working in SQL Server 2000? And what's the substitute command?
And second problem is what's the failure in my "after insert" trigger?
And finally, is there any alternative solution for that?
Thanks you for your help.
UPDATE :
Now, the server process is locked when I insert record in that table !!!! WHAT IS MY MISTAKE?