Header Ads Widget

Responsive Advertisement

Get all table names and column names of database in SQL Server database


Live Video:






Get all table names and column names of database in SQL Server database


-----------Get Table names------------
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='DatabaseName'

----------Get Column Names-----------

SELECT COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME='TableName'

Post a Comment

0 Comments