How to See Columns from SQL Server Query

Here I am writing a query to see the column list of table t_name

select * from sys.columns where object_id=OBJECT_ID(t_name)

 
It will show all columns and

select * from sys.columns where object_id=OBJECT_ID(t_name) and is_identity !=1

Example

select * from sys.columns where object_id=OBJECT_ID('User_Login')

will show all columns after remove identity columns

we can also make many query from help of types

select * from sys.types

it will show all types and their code .

Example

select * from sys.columns where object_id=OBJECT_ID('User_Login') and user_type_id=56

it will show all columns who have integer type.

Ebook Download
View all
Learn
View all