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)
 print columns name

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-07-27 : 17:01:52
How to retrive a list of columns name in A table?

Which system stored procedure should i use?



bmanoj
Starting Member

13 Posts

Posted - 2004-07-27 : 17:09:03
select COLUMN_NAME + ',' from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME = 'TableName'
order by ORDINAL_POSITION

HTH,
Manoj
Go to Top of Page

jcortiz1
Starting Member

3 Posts

Posted - 2004-07-27 : 17:11:56
Mas facil:
exec sp_columns_rowset TableName

jcortiz1
Go to Top of Page

jcortiz1
Starting Member

3 Posts

Posted - 2004-07-27 : 17:13:17
How to retrive a list of columns name in A procedure?

jcortiz1
Go to Top of Page

Pat Phelan
Posting Yak Master

187 Posts

Posted - 2004-07-27 : 18:07:00
Do you mean how do you retrieve information about the columns from the result set returned by the stored procedure?

-PatP
Go to Top of Page
   

- Advertisement -