Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: choic
  • Order by date
  1. choic

    Create a table in a stored procedure dynamically

    Hi Tim I tried a few different ways but all are prompted with errors: Example 1: DECLARE @tablename varchar(30) SELECT @tablename = 'hi' CREATE TABLE @tablename (column_1 int) Error: Incorrect syntax near '@tablename'. Example 2: DECLARE @tablename varchar(30) DECLARE @sql varchar(200)...
  2. choic

    Create a table in a stored procedure dynamically

    Hi Tim, Mine is version 11.92. Does it support dynamic SQL? Thanks for your help. Ricky
  3. choic

    Create a table in a stored procedure dynamically

    Hi there Is there any way to create a table in a stored procedure dynamically where the table name is based on a variable? I did something as follows but it does not work. Declare @sql varchar(255) Declare @table_name varchar(30) Select @table_name = 'my_table_01_2001' Select @sql = 'create...
  4. choic

    Check the existence of a table in a stored procedure

    Hi there Is there any way to check a table's existence before its creation in one stored procedure?? I did something as follows but it does not work. Please help me ... Declare @sql varchar(255) Select @sql = 'create table test (column_1 int primary key) If (Exec @sql) <> 0 print 'Failed'...

Part and Inventory Search

Back
Top