all groups > sql server (alternate) > november 2006 >
You're in the

sql server (alternate)

group:

SQL Server 2005 objects question


SQL Server 2005 objects question vajarov
11/28/2006 1:26:17 PM
sql server (alternate):
Hi guys,
I am pretty happy with the new system views in SQL 2005 but there is
one thing I could not figure out: What is the view that let you see
what object belongs to what DB? Sorry for the simple question, Cheers,
G.
Re: SQL Server 2005 objects question Erland Sommarskog
11/28/2006 10:38:23 PM
vajarov (vajarov@gmail.com) writes:
[quoted text, click to view]

I'm not really sure that I understand it. Objects are either server-bound
or database-bound. And if it's database-bound, the object is referred to
by db.schema.name. If you have a single-part name like 'mytable', then
that object belongs to the current database. (There are some exceptions
when it comes to the system views itself, but let's ignore that.)


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
Re: SQL Server 2005 objects question mladjo
11/29/2006 3:08:22 AM
Hi.

For example:
USE AdventureWorks
GO
SELECT * FROM
INFORMATION_SCHEMA.columns


OR you can to do something like this:
SELECT * FROM SYS.views
SELECT * from SYS.TABLES

Re: SQL Server 2005 objects question mladjo
11/29/2006 3:14:21 AM
Hi.


For example:
USE AdventureWorks
GO
SELECT * FROM
INFORMATION_SCHEMA.columns
This chunk of code will select important information. I hope that is the
answer on your question.

OR you can do something like this:
SELECT * FROM sys.views, SELECT * FROM sys.tables, SELECT * FROM
sys.objects, SELECT * FROM sys.views...

AddThis Social Bookmark Button