Results 1 to 2 of 2

Thread: Copying Tables

  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Unanswered: Copying Tables

    Hi,

    I'd like a really simple way of making a replica of a table. The thing is i'd like the table name to be a variable. The following code doesn't work, any ideas??

    Thanks in advance,

    Alph

    CREATE Procedure Test

    @vMonth as varchar(3)

    As

    SELECT tbl_Targets.* INTO @vmonth
    FROM tbl_Targets;
    GO

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Look up sp_executesql and EXECUTE in the SQL Books Online.
    That which does not kill me postpones the inevitable.

Posting Permissions

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