Get table structure using SQL query in SQL Server

Here it s the query for retrieve the table structure in sql server,


SELECT Ordinal_Position,Column_Name,Data_Type,Is_Nullable,Character_Maximum_Length
INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='table Name'

Comments

Popular posts from this blog

SQL SERVER – TRIM() Function – UDF TRIM()