Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Posts
    5

    Question Unanswered: Create Table with dynamic name

    Hi everyone,
    I try to create tables with dynamic names, that means that i add the creation date to the table name ( e.g. myTable20020301 ) in Sybase 11
    Is there any possibility to use a parameter as tablename ?

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    ASE 11 didn't support dynamic SQL via the 'EXEC(..)' function. Are you using stored procedures I assume? What I'd do is send the raw SQL from an application, but perhaps this won't work in your case. Maybe also try using xp_cmdshell and running a script to create the table that way (e.g. myscript '20020301').
    Thanks,

    Matt

  3. #3
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    http://www.sypron.nl/dynsql.html

    Create the table with some name which you won't be using, then rename it with sp_rename.
    Thanks,

    Matt

Posting Permissions

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