Skip to content

SQL Tables schema

October 10, 2022

To get Table and column names

SELECT name FROM sys.columns WHERE object_id = OBJECT_ID(‘FlatFileDataHolder’)

To get Table and column names and data types

select col.name as ‘ColumName’,typ.name as ‘DataType’ from sys.columns col left join sys.types typ
on col.system_type_id=typ.system_type_id where object_id=object_id(‘FlatFileDataHolder’)

To get all tables and their schema

SELECT * FROM INFORMATION_SCHEMA.COLUMNS

Advertisement

From → Database

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: