Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to see structure of a view

Status
Not open for further replies.

Lahorem

Programmer
Feb 17, 2006
18
GB
As a newbie to sql, this question may be very basic
but I have a view called 'config' and I would like to see which fields it is pulling out without running it (i.e Select * from config)

Additionally I don't know where the .sql files are stored for this view.

Lastly, i have tried sp_help config but this didn't do the work as I am sure most of you would have gussed.

Many thanks in advance for your help.
 
SELECT c.TABLE_NAME,
TABLE_TYPE,
COLUMN_NAME,
ORDINAL_POSITION,
IS_NULLABLE,
DATA_TYPE,
NUMERIC_PRECISION
FROM INFORMATION_SCHEMA.COLUMNS c
JOIN INFORMATION_SCHEMA.TABLES t ON c.TABLE_NAME = t.TABLE_NAME
WHERE c.TABLE_NAME ='config'
ORDER BY TABLE_TYPE ,c.TABLE_NAME

or even easier
select * from config where 1 = 0



Denis The SQL Menace
SQL blog:
Personal Blog:
 
select * from config where 1 = 0

That did it cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top