/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT 'public const string COLUMN_' + UPPER(col.TABLE_NAME) + '_' + UPPER(col.COLUMN_NAME) + ' = "' + col.COLUMN_NAME + '";' As [Name] FROM INFORMATION_SCHEMA.COLUMNS col INNER JOIN INFORMATION_SCHEMA.TABLES tab ON tab.TABLE_NAME = col.TABLE_NAME WHERE tab.TABLE_TYPE = 'BASE TABLE' AND tab.TABLE_NAME NOT IN ('dtproperties', 'sysdiagrams') UNION SELECT 'public const string TABLE_' + UPPER(tab.TABLE_NAME) + ' = "' + tab.TABLE_NAME + '";' As sName FROM INFORMATION_SCHEMA.TABLES tab WHERE tab.TABLE_TYPE = 'BASE TABLE' AND tab.TABLE_NAME NOT IN ('dtproperties', 'sysdiagrams') ORDER BY [Name] ASC