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 2005 Forums
 Transact-SQL (2005)
 Find all the Columns in a particular table

Author  Topic 

Progress2007
Starting Member

17 Posts

Posted - 2009-03-17 : 09:35:35
Hello
I want to get all the information for a table like Column name, Column type etc, I have used Information_Schema_Columns in SQL 2005 but can not able to use it.

Can u great people tell me how can i do this

pootle_flump

1064 Posts

Posted - 2009-03-17 : 09:37:51
[code]SELECT *
FROM sys.columns
WHERE object_id = OBJECT_ID('dbo.myTableName')[/code]
Go to Top of Page

mfemenel
Professor Frink

1421 Posts

Posted - 2009-03-17 : 09:38:34
With a little work getting the id's turned into names you could use sys.columns. What do you mean you can't use information_schema? It's not there or you don't have permissions to it? I ask because you may find the same problem with sys.columns. You could also try sp_help if you're just browsing tables.

Mike
"oh, that monkey is going to pay"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-17 : 11:12:13
quote:
Originally posted by Progress2007

Hello
I want to get all the information for a table like Column name, Column type etc, I have used Information_Schema_Columns in SQL 2005 but can not able to use it.

Can u great people tell me how can i do this


its Information_Schema.Columns. try this
select * from information_schema.columns where table-name ='your table name'
Go to Top of Page
   

- Advertisement -