Get all the column names of a table in SQL


Get all the columns of a table in SQL


select * from sys.all_columns C 
join sys.tables T on C.object_id = T.object_id 
where t.name like '%TABLENAME%' 
order by c.name




This query is used to get all the columns and their details in the result window. Hope it will be useful for a huge table... :-)


No comments:

Post a Comment

Keep ur coding aside.. Relax for some time..