This is a discussion on Re: Newbie triggers help required please. within the SQL Server forums, part of the Microsoft SQL Server category; --> I think you're typing your trigger code in the "New stored procedure" dialogue. If you want to create triggers ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I think you're typing your trigger code in the "New stored procedure" dialogue. If you want to create triggers via Enterprise Manager, you need to right-click the table and select All Tasks - Manage Triggers. Simon ".NET Developer" <pleasereplytogroups@hotmail.com> wrote in message news:66900ea6.0307010233.51b23064@posting.google.c om... > Hello everyone, > > I would like to create my first simple trigger, but when I try to save > the trigger inside Enterprise Manager, it gives me the following > error: > > Error 21001 : [SQL-DMO] Stored procedure definition must include name > and text (for Standard StoredProcedure) or libraryname (for Extended > StoredProcedure). > > The actual trigger itself is, I think, fairly straight forward: > > CREATE trigger UpdateCache > on MyTable > for update, delete, insert > as > declare @cmd varchar(200) > select @cmd = 'echo ' + cast(getDate() as varchar(50)) + ' > > c:\tablechange.txt' > exec master..xp_cmdshell @cmd, no_output > > Any help would be greatly appreciated. > > Best regards from Robert. |
| ||||
| Thanks very much for your help Simon. "Simon Hayes" <sql@hayes.ch> wrote in message news:<3f016c89_2@news.bluewin.ch>... > I think you're typing your trigger code in the "New stored procedure" > dialogue. If you want to create triggers via Enterprise Manager, you need to > right-click the table and select All Tasks - Manage Triggers. > > Simon > > ".NET Developer" <pleasereplytogroups@hotmail.com> wrote in message > news:66900ea6.0307010233.51b23064@posting.google.c om... > > Hello everyone, > > > > I would like to create my first simple trigger, but when I try to save > > the trigger inside Enterprise Manager, it gives me the following > > error: > > > > Error 21001 : [SQL-DMO] Stored procedure definition must include name > > and text (for Standard StoredProcedure) or libraryname (for Extended > > StoredProcedure). > > > > The actual trigger itself is, I think, fairly straight forward: > > > > CREATE trigger UpdateCache > > on MyTable > > for update, delete, insert > > as > > declare @cmd varchar(200) > > select @cmd = 'echo ' + cast(getDate() as varchar(50)) + ' > > > c:\tablechange.txt' > > exec master..xp_cmdshell @cmd, no_output > > > > Any help would be greatly appreciated. > > > > Best regards from Robert. |