Unix Technical Forum

Re: Newbie triggers help required please.

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 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 06:00 PM
Simon Hayes
 
Posts: n/a
Default Re: Newbie triggers help required please.

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.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 06:00 PM
.NET Developer
 
Posts: n/a
Default Re: Newbie triggers help required please.

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com