all groups > sql server programming > october 2003 >
You're in the

sql server programming

group:

Column name and data type in the sql server 6.5


Column name and data type in the sql server 6.5 Sanka .
10/15/2003 10:22:53 PM
sql server programming:
Hi All,

Can anyone tell me how to get the data type and other details of a
column through a database query in sql server. We are using sql server
6.5.

For e.g. I’m running a query like this “select a.name,b.name from
sysobjects a,syscolumns b where b.name like 'Property_Type%' and
a.type='U' and a.id=b.id” to get the tables in which column
Property_Type exists; along with this I need to know the column
properties like data type and the constraints in the same.

Any Ideas...

Cheers,
Sanka

*** Sent via Developersdex http://www.developersdex.com ***
Re: Column name and data type in the sql server 6.5 Tibor Karaszi
10/16/2003 8:13:41 AM
To get the datatype, you need to join against the systypes table.

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver


[quoted text, click to view]

AddThis Social Bookmark Button