Tags: asp, column, description, programming, returned, server, sql, table, textual, type

Get data type of column

On Programmer » SQL

1,217 words with 3 Comments; publish: Thu, 29 May 2008 02:20:00 GMT; (20046.88, « »)

How do I get a textual description of the data type of a SQL Server table

column?

(Returned to ASP preferably)

All Comments

Leave a comment...

  • 3 Comments
    • SELECT data_type

      FROM information_schema.columns

      WHERE table_schema = 'dbo'

      AND table_name = 'table_name'

      AND column_name = 'col' ;

      --

      David Portas

      SQL Server MVP

      --

      #1; Thu, 29 May 2008 02:21:00 GMT
    • Mike wrote:

      > How do I get a textual description of the data type of a SQL Server

      > table column?

      > (Returned to ASP preferably)

      It depends on if you want the T-SQL datatype, or the vbscript datatype, or

      the jscript datatype if you are using jscript.

      --

      Microsoft MVP -- ASP/ASP.NET

      Please reply to the newsgroup. The email account listed in my From

      header is my spam trap, so I don't check it very often. You will get a

      quicker response by posting to the newsgroup.

      #2; Thu, 29 May 2008 02:22:00 GMT
    • Hi,

      Execute the system procedure

      sp_columns <Table_name>

      Thanks

      Hari

      SQL Server MVP

      "Mike" <mike.sql.todaysummary.com.hello.com> wrote in message

      news:OaxhvLzoFHA.3828.sql.todaysummary.com.TK2MSFTNGP12.phx.gbl...

      > How do I get a textual description of the data type of a SQL Server table

      > column?

      > (Returned to ASP preferably)

      >

      #3; Thu, 29 May 2008 02:23:00 GMT