Solved

Details on SQL Server dbo and INFORMATION_SCHEMA

Posted on 2012-03-22
2
349 Views
Last Modified: 2012-04-10
Hi,
Can someone explain how dbo (database owner) works?  I have most tables under dbo but there are some which are under different user.

Also how can I use INFORMATION_SCHEMA to list details of tables,indexes ?

Thanks
0
Comment
Question by:crazywolf2010
2 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 37751711
0
 
LVL 25

Accepted Solution

by:
jogos earned 500 total points
ID: 37751716
<<Can someone explain how dbo (database owner) works?>>
There is a historical reason where you must be carefull when talking about dbo. There is the database owner as a role db_owner http://msdn.microsoft.com/en-us/library/ms189121(v=sql.90).aspx
and the dbo schema, the automatic default schema http://msdn.microsoft.com/en-us/library/ms190387.aspx

<<  I have most tables under dbo but there are some which are under different user.>>
Most tables under the schema dbo that's logic because it's the default
and some under a different schema not user, that was the historical part until it changed with version 2005.



<<Also how can I use INFORMATION_SCHEMA to list details of tables,indexes ?>>
Depends on what details you want

select * from informations_chema.tables
Select * from information_schema.columns
More info http://msdn.microsoft.com/en-us/library/ms186778.aspx
But more detailed info tables you can find in sys.tables and sys.objects,  sys.indexes.

You can join them together as much as you want. OBJECT_ID() and OBJECT_NAME() can be helpfull to change from one type to the other.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question