Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql server datatypes

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-03-02 : 07:55:51
shaheenbaig writes "i want a query to find the exact column names, their datatypes and the size of the datatype in a particular table in a database.
please help
thanks in advance."

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-02 : 08:08:14
select * from information_schema.columns
where table_name='tableName'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-02 : 08:12:38
SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH
from INFORMATION_SCHEMA.Columns
where table_name = 'UrTblName'
Go to Top of Page
   

- Advertisement -