Get data type of column

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

(Returned to ASP preferably)
Mike [ Mi, 17 August 2005 15:53 ] [ ID #926298 ]

Re: Get data type of column

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
--
David Portas [ Mi, 17 August 2005 15:55 ] [ ID #926299 ]

Re: Get data type of column

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.
reb01501 [ Mi, 17 August 2005 16:28 ] [ ID #926300 ]

Re: Get data type of column

Hi,

Execute the system procedure

sp_columns <Table_name>

Thanks
Hari
SQL Server MVP



"Mike" <mike [at] hello.com> wrote in message
news:OaxhvLzoFHA.3828 [at] TK2MSFTNGP12.phx.gbl...
> How do I get a textual description of the data type of a SQL Server table
> column?
>
> (Returned to ASP preferably)
>
Hari Prasad [ Mi, 17 August 2005 21:37 ] [ ID #926303 ]
Webserver » microsoft.public.inetserver.asp.db » Get data type of column

Vorheriges Thema: ASP Login and statistics
Nächstes Thema: Solution for Unspecified Error on Windows 2000 using Jet