devxlogo

Find Out the Column Name Using the COL_NAME() Function

Find Out the Column Name Using the COL_NAME() Function

You can use the following snippet to quickly find out a column’s name.

COL_NAME accepts two parameters: TableID and the ordinal position.

SELECT COL_NAME(object_id('waybill'),2) AS col_name

devx-admin

Share the Post: