Becks25Not
Programmer
Hello,
I hava trigger on a table (settings table) that creates a text file after any data changes are made to the table. (The table is not updated requently but several things need to happen when it is). The trigger and everything works if I mahe changes in SQL Manager. But when I execute changes from .NET using a command, I get this error: "A severe error occurred on the current command. The results, if any, should be discarded." It inserts / updates the records so I am guessing it is happening on the trigger. There is nothing in the SQL logs. I have searched but all of the reasons for this did not seem to fit my scenario.
My Trigger:
Any help is greatly appreciated!!
~Becca
I hava trigger on a table (settings table) that creates a text file after any data changes are made to the table. (The table is not updated requently but several things need to happen when it is). The trigger and everything works if I mahe changes in SQL Manager. But when I execute changes from .NET using a command, I get this error: "A severe error occurred on the current command. The results, if any, should be discarded." It inserts / updates the records so I am guessing it is happening on the trigger. There is nothing in the SQL logs. I have searched but all of the reasons for this did not seem to fit my scenario.
My Trigger:
Code:
CREATE TRIGGER [Updated] ON [dbo].[StApplicationSettings]
FOR INSERT, UPDATE, DELETE
AS
DECLARE @cmd varchar(200)
SELECT @cmd = 'echo' + Cast(getDATE() as Varchar(50)) +
' > \\Path\SettingsFiles\SettingsUpdate.txt'
EXEC master..xp_cmdshell @cmd, no_output
Any help is greatly appreciated!!
~Becca