Results 1 to 3 of 3

Thread: sql query

  1. #1
    Join Date
    Jul 2003
    Posts
    37

    Unanswered: sql query

    What is wrong with my sql command?

    select Table_Name, column_name + ' ' + Upper(data_type) + ' ' +
    CASE
    When data_type = bigint then '4'
    WHEN data_type = char then Cast(character_maximum_length As varchar(10))
    ELSE 'Whatever'
    END 'Columns'
    from information_schema.columns

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    looks okay to me

    are you getting an error?

    i have a similar query on the information_schema .columns table, but it's at work and i won't be able to get to it until monday


    rudy
    http://r937.com

  3. #3
    Join Date
    Dec 2002
    Location
    Antwerp, Belgium
    Posts
    227
    your data types need to be between quotation marks ('bigint', 'char').
    Johan

Posting Permissions

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