Tuesday, 28 January 2020

Get all column names from database table with specific schema in SQL Server

Many times there’s a requirement to get all columns for a particular table in database. Hence here is a SQL Query that does that.


SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Your Table Name'
ORDER BY ORDINAL_POSITION

No comments:

Post a Comment

redirect to new page from jquery

  function foo(id) { var url = ' @Url . Action ( "Details" , "Branch" , new { id = "__id__" })'...