Get Field Name and Type of Database Table in SQL SERVER

this tutorial is showing how to get field name and type etc. in MS-SQL server.

This example using sample database AdventureWorks.

USE AdventureWorks
GO
SELECT column_name 'Column Name',
data_type 'Data Type',
CHARacter_maximum_length 'Maximum Length'
FROM information_schema.columns
WHERE table_name = 'Address'
GO

Advertisements