473,394 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

SQL Best Practices Analyzer Rule: Use of Schema Qualified Tables/Views

SQL BPA says the following:

"One or more objects are referencing tables/views without
specifying a schema! Performance and predictability of the
application may be improved by specifying schema names."

"When SQL Server looks up a table/view without a schema
qualification, it first searches the default schema and then the
'dbo' schema. The default schema corresponds to the current
user for ad-hoc batches, and corresponds to the schema of a
stored procedure when inside one. In either case, SQL Server
incurs an additional runtime cost to verify schema binding of
unqualified objects. Applications are more maintainable and
may observe a slight performance improvement if object
references are schema qualified."

How important is to specify the schame (dbo. in my case) in
stored procedures? Will it really improve performance if I go
and fix each object that is missing "dbo."?

The problem is I have thousands and thousands of them
with no schemas. Before I invest a lot of time fixing them
I am trying to determine if it's really worth it or not?

Thank you
Dec 16 '05 #1
1 3952
> How important is to specify the schame (dbo. in my case) in
stored procedures? Will it really improve performance if I go
and fix each object that is missing "dbo."?
It will improve performance but the 'slight performance improvement'
probably doesn't justify a significant effort to implement the
recommendation for thousands of instances. However, you should
schema-qualify objects for new development and perhaps as you perform
maintenance.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"serge" <se****@nospam.ehmail.com> wrote in message
news:gO********************@weber.videotron.net... SQL BPA says the following:

"One or more objects are referencing tables/views without
specifying a schema! Performance and predictability of the
application may be improved by specifying schema names."

"When SQL Server looks up a table/view without a schema
qualification, it first searches the default schema and then the
'dbo' schema. The default schema corresponds to the current
user for ad-hoc batches, and corresponds to the schema of a
stored procedure when inside one. In either case, SQL Server
incurs an additional runtime cost to verify schema binding of
unqualified objects. Applications are more maintainable and
may observe a slight performance improvement if object
references are schema qualified."

How important is to specify the schame (dbo. in my case) in
stored procedures? Will it really improve performance if I go
and fix each object that is missing "dbo."?

The problem is I have thousands and thousands of them
with no schemas. Before I invest a lot of time fixing them
I am trying to determine if it's really worth it or not?

Thank you

Dec 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gordon Dickens | last post by:
I have target xml to generate from schema. All of the XML instances have the same global element i.e. <base>. I would like to combine all of the schemas into a single schema where I could...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
6
by: btober | last post by:
Is there a way to get a dump of all the DDL and data associated with a single schema within a database? What I tried in attempting to hack this out was \dt consume.* and \dv consume.*
0
by: Dave | last post by:
Hi all, I'm looking at designing an XSD for a signed document (enveloping) to be received from a third party. Primarily, I'm interested in what is the "best practice" with regards the...
7
by: James Foreman | last post by:
We have 5 users of our database (DB2 UDB 8.1 on SuSE linux) : db2inst1 bill fred sarah jessica The tables are created under db2inst1, which has the ability to drop/create/alter/etc. bill,...
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
17
by: | last post by:
I have an app that retrieves data from an Access database. At the moment I have the SQL string as a Const in my app. I understand this is not best practice. I don't want the user to have access to...
4
by: Collin Peters | last post by:
I have searched the Internet... but haven't found much relating to this. I am wondering on what the best practices are for migrating a developmemnt database to a release database. Here is the...
2
by: Eddie | last post by:
I have a DataSet with relations and other constraints being populated from the backend (SQL Server 2005). I use DataSet.FillSchema to retrieve the table schema for each table in the dataset. I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.