SQL Server Get All Column Names of a Table
By Michael Detras
Here is an SQL script to get all the column names of a table.
select name from sys.columns where object_id = OBJECT_ID('dbo.TableName')
Related FAQs
To delete all the rows in a SQL Server table, we just use the following SQL script: DELETE FROM TABLE_NAME. To delete the data in all tables, we can use the spMSForEachTable stored procedure to execute the script for each table.
SQL Server Get All Column Names of a Table (1294 Views)