Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2002
    Posts
    162

    Red face Unanswered: dynamically naming Columns?

    Does anyine have an example (strored proc or something) where you can dynamically name columns in a "select into statement" or "create table statement" based on certain criteria in a sql or something

    I basically have 2 tables that are created from 2 diff. sql's . The first table contains a "change_key" and a "title" each change_key corresponding to a title and the other table just has data with each row diffrentiated by six columns that make up a composite primary key.

    I need to create a brand new table as a fusion of these 2 tables and add new columns based on the different titles that exist in the first table. I will not know the amount of data (different titles) that will appear in the first table because this table is created as a result of the change_key inner joined with another table entirely. I believe I have to do this in a procedure...................PLS HELP!!!

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    What ASE version are you using?
    Thanks,

    Matt

  3. #3
    Join Date
    Mar 2002
    Posts
    162
    ASE 11.5...pls. don't tell me it can't be done with this version

  4. #4
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Thanks,

    Matt

  5. #5
    Join Date
    Mar 2002
    Posts
    162
    Thanks. Seems helpful, I'll try it out.

Posting Permissions

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