Re: Newbie Question - Creating Triggers within Stored Procedures
anonymous_at_discussions.microsoft.com
Date: 08/06/04
- Next message: Jacco Schalkwijk: "Re: ORDER BY CASE failure on Computed Field"
- Previous message: Partha Mandayam: "Re: Newbie Question - Creating Triggers within Stored Procedures"
- In reply to: Andrew J. Kelly: "Re: Newbie Question - Creating Triggers within Stored Procedures"
- Next in thread: Partha Mandayam: "Re: Newbie Question - Creating Triggers within Stored Procedures"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 6 Aug 2004 14:45:06 -0500
Aaahhhh...thank you, Andrew.
Take care.
"Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
news:u73RI1%23eEHA.1764@TK2MSFTNGP10.phx.gbl...
> You can't have a GO in the stored procedure code. You can wrap each of
the
> pieces (table creation and trigger etc) in Dynamic sql though.
>
> EXEC('CREATE TABLE.....')
>
> EXEC('CREATE TRIGGER ...')
>
>
> --
> Andrew J. Kelly SQL MVP
>
>
> <anonymous@discussions.microsoft.com> wrote in message
> news:OCOXtr%23eEHA.4092@TK2MSFTNGP10.phx.gbl...
> > I have a migration procedure that fires off dozens of other stored
> procedure
> > to create tables, relationships, etc. Can I also create triggers on
those
> > newly-created tables by using those same procedures? I tried syntax
> similar
> > to below, but it of course didn't work.
> >
> > Thank you
> >
> > \\\
> > ALTER PROCEDURE dbo.usp_migrate_CreateTable8
> > AS
> > CREATE Table8
> > ...
> > ...
> > GO
> > CREATE TRIGGER Table8_INSERT ON Table8 FOR INSERT
> > AS
> > --<<Trigger code>>
> >
> > GO
> > ///
> >
> >
>
>
- Next message: Jacco Schalkwijk: "Re: ORDER BY CASE failure on Computed Field"
- Previous message: Partha Mandayam: "Re: Newbie Question - Creating Triggers within Stored Procedures"
- In reply to: Andrew J. Kelly: "Re: Newbie Question - Creating Triggers within Stored Procedures"
- Next in thread: Partha Mandayam: "Re: Newbie Question - Creating Triggers within Stored Procedures"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|