0 votes
1 view
in Web Technology by (20.3k points)

How would I return the column names of a table using SQL Server 2008? i.e. a table contains these columns- id, name, address, country and I want to return these as data.

1 Answer

0 votes
by (40.3k points)

If you are using 2008 version, try using the code given below:

USE [Database Name]

SELECT COLUMN_NAME,* 

FROM INFORMATION_SCHEMA.COLUMNS

WHERE TABLE_NAME = 'YourTableName' AND TABLE_SCHEMA='YourSchemaName'

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 25, 2019 in SQL by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...