Professional Web Applications Themes

size of the results of a SQL query - Microsoft SQL / MS SQL Server

Hello I'd like to know the datatype of all columns of a SQL query. For instance, for the query : "select NAME, PHONENUMBER from PEOPLE", I'd like to get the type of NAME and the type of PHONENUMBER (varchar and number, in my sample). I can do this by doing a "desc PEOPLE". It will work in my sample, but not with a more complexe query like "select NAME, JOBNAME from JOBS j, PEOPLE p where p.JOBID = j.JOBID". How to get the size of NAME and JOBNAME ? I need this in order to create a generic window that ...

  1. #1

    Default size of the results of a SQL query

    Hello

    I'd like to know the datatype of all columns of a SQL query. For instance,
    for the query : "select NAME, PHONENUMBER from PEOPLE", I'd like to get the
    type of NAME and the type of PHONENUMBER (varchar and number, in my
    sample).

    I can do this by doing a "desc PEOPLE". It will work in my sample, but not
    with a more complexe query like "select NAME, JOBNAME from JOBS j, PEOPLE p
    where p.JOBID = j.JOBID". How to get the size of NAME and JOBNAME ?

    I need this in order to create a generic window that can show results of
    any given query.

    thanks you

    Neiger Thibaut
    thibaut neiger Guest

  2. #2

    Default Re: size of the results of a SQL query

    >"desc PEOPLE"
    I think this is the syntax of oracle , SQL server equivalent is sp_help
    <table name>.
    If you want to return it through SQL query. you can refer to
    information_schema.columns view.

    --
    -Vishal
    "thibaut neiger" <neigerifrance.com> wrote in message
    news:Xns93AE79B2A16DFneigerifrancecom193.252.19.1 41...
    > Hello
    >
    > I'd like to know the datatype of all columns of a SQL query. For instance,
    > for the query : "select NAME, PHONENUMBER from PEOPLE", I'd like to get
    the
    > type of NAME and the type of PHONENUMBER (varchar and number, in my
    > sample).
    >
    > I can do this by doing a "desc PEOPLE". It will work in my sample, but not
    > with a more complexe query like "select NAME, JOBNAME from JOBS j, PEOPLE
    p
    > where p.JOBID = j.JOBID". How to get the size of NAME and JOBNAME ?
    >
    > I need this in order to create a generic window that can show results of
    > any given query.
    >
    > thanks you
    >
    > Neiger Thibaut

    Vishal Parkar Guest

Similar Threads

  1. Complex join = no results (for a query that shouldreturn results)
    By jchapman16 in forum Coldfusion Database Access
    Replies: 4
    Last Post: August 23rd, 10:49 PM
  2. Query results don't display properly in results table.IGNORE PREVIOUS
    By JoyRose in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: March 24th, 07:28 PM
  3. Query results don't display properly in results table.
    By JoyRose in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: March 24th, 07:17 PM
  4. specifying query results
    By joeunion in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: February 11th, 07:13 PM
  5. Getting too many results from a query!
    By Wm in forum PHP Development
    Replies: 2
    Last Post: August 17th, 03:45 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139