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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[B]How to name a stored proc without dbo [/B]

Status
Not open for further replies.

Mack2

Instructor
Mar 12, 2003
336
US
When I create a stored procedure or view it always appends dbo at the beginning of the name. What is the command to use so it does not add the dbo to the front of the name. THANKS IN ADVANCE FOR ANY HELP!!!
 
You can't. The dbo part is the schema, it stands for "Data Base Owner". Every object belongs to a schema.

Is the dbo part causing you problems?

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Go to Tools/Options/SQL Server Object Explorer/Scripting.

Scroll down to the second section and change "Schema qualify object names" to false.
 
No, not causing a problem. The rest of the objects do not have the dbo as part of the name.

Thanks markros, I will try it this afternoon and let you know.
 
In SQL Server 2000 if the person creating the object doesn't have sysadmin rights and there logon isn't mapped directly to the dbo user then when they create objects they will be created in the users schema. This is by design.

In SQL Server 2005+ you can change the default schema of the user so that there objects are created in the dbo schema by default. This can only be done if the user is logging in via a SQL Login, or a Windows login that is specifically specified in the Security section of both the Instance and the database. You can not get the default schema for Windows groups.

It is best practice to always include the name of the schema when creating or modifying objects so that you know which object you are working with.

Denny
MVP
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / SQL 2005 BI / SQL 2008 DBA / SQL 2008 DBD / SQL 2008 BI / MWSS 3.0: Configuration / MOSS 2007: Configuration)
MCITP (SQL 2005 DBA / SQL 2008 DBA / SQL 2005 DBD / SQL 2008 DBD / SQL 2005 BI / SQL 2008 BI)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top