Возврат имена столбцов в таблице SQL
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Customers'
Joyous Jackal
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Customers'
SELECT c.name AS 'ColumnName'
,t.name AS 'TableName'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%MyName%'
ORDER BY TableName
,ColumnName;
SELECT
TABLE_SCHEMA AS TABLE_SCHEMA
,TABLE_NAME AS TABLE_NAME
,COLUMN_NAME AS COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
--Where COLUMN_NAME Like '%Put_Your_Comumn_Name_HERE%'
ORDER BY
TABLE_SCHEMA
,TABLE_NAME
,COLUMN_NAME;