Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    42

    Angry Unanswered: two problems with trigger & procedure

    Sir,

    I have to fire a trigger as soon as insert happen in one table & whatever latest data should be transfered to other table.

    IN a procedure i have stored value in variable like this
    select @g = game12

    Now i want to use this variable to create table :

    create table @g ........

    How to do that

    Regards
    Bala

  2. #2
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    You need to use "execute immediate":

    declare @cmd varchar(255)
    select @cmd = "create table " + @g + "( columns...."
    exec (@cmd)

    Michael

  3. #3
    Join Date
    Sep 2005
    Posts
    42

    Talking Thanks Michal

    Thanks a lot michal.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •