Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Table name as variable

    I use this quite alot...

    -----------------------------------------

    CREATE PROCEDURE [dbo].[sp_CreateOutTable]

    @TableName varchar(50)

    AS

    DECLARE @sql varchar (255)

    SET @sql = 'SELECT * FROM '+ @TableName

    EXEC (@SQL)

    ------------------------------------------

    Works everytime...

Viewing post 1 (of 1 total)