gogetsome
asked on
Select * column names
Hello, is it possible to select all of the column names for a particular table? If so, how is that accomplished?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your question is not clear
1. If you want the name of columns as output use this
Select * from syscolumns where ID =Object_ID('TableName')
2. if you want data from all the columns use this:
select * from tablename
1. If you want the name of columns as output use this
Select * from syscolumns where ID =Object_ID('TableName')
2. if you want data from all the columns use this:
select * from tablename
SELECT dbo.syscolumns.name AS ColName
FROM dbo.syscolumns INNER JOIN
dbo.sysobjects ON dbo.syscolumns.id =
dbo.sysobjects.id
WHERE (dbo.sysobjects.name = 'your table name')
FROM dbo.syscolumns INNER JOIN
dbo.sysobjects ON dbo.syscolumns.id =
dbo.sysobjects.id
WHERE (dbo.sysobjects.name = 'your table name')
SELECT Column_name
from Information_schema.Columns
WHERE Table_Name = 'urTableName'