SQLTeam.com | Weblogs | Forums

SQL Statement

How to create a view outlining the whole database?

what have you done so far?

It is a homework but i am not looking for someone to do my homework for me I just wanted some pointers that's all

What do you mean by
view outlining the whole database?

to create a view showing all the columns in one database

There are views out of the box under system views

thank you

hope this helps
:slight_smile: :slight_smile:

there are in SQL Server ........ information_Schema
views .. ( all kinds ... tables ...table columns .. etc etc etc)

please google search !!!

Check our database diagrams under the database node in SSMS.

I'd look at

select * from sysobjects
select * from syscolumns
select * from systypes

No! Those views are obsolete.

Look at:
sys.objects
sys.columns
sys.types
etc.

I think sysobjects, syscolumns, and systypes are the raw tables, right?

As Scott said those are obsolete (deprecated) views that may not be supported is future releases of SQL Server. Also INFORMATION_SCHEMA Views aren't always reliable after SQL Server 2005. https://stackoverflow.com/questions/7217886/unreliable-information-schema-schema-information-on-sql-server

1 Like

No, those aren't the raw / actual tables, those are also views.

If you display the query plan for "SELECT TOP (10) * FROM sysobjects", you see a table named "sysschobjs". That may be the actual table (or that could possibly also be just some synonym or view).