Feeds:
Posts
Comments

Posts Tagged ‘SQL SERVER – How to view the column information of table or view without executing any query.’

“How to view the column information of table or view without executing any query ?” One of my colleagues questioned me and it became more interesting when he declared that I need to show all the column name of a table including its data type, without using any t-sql or object explorer either.

Given below is the query :

use AdventureWorks2012
Go
Select * from [dbo].[Sales]

sqlserverblog_83_1.1

Answer :

The answer is very simple, you just need to move your mouse and keep it over * and the SQL SERVER will display the column name along with data type shown in the picture below.
Note : This solution will work on sql server 2008 and above.

sqlserverblog_83_1.2

Have a better solution?

Advertisements

Read Full Post »