Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Should proc owner be qualified when executing?

Author  Topic 

MorrisK
Yak Posting Veteran

83 Posts

Posted - 2009-11-12 : 15:18:25
The following KB articles recommend that references to stored procedures be qualified with the owner name.

http://support.microsoft.com/kb/263889

http://support.microsoft.com/kb/243586

However, all the examples of code that call stored procedures I have been able to find do not appear to following this recommendation.

For example -

http://www.developer.com/db/article.php/3438221/Calling-Stored-Procedures-with-ADONET

http://www.vbdotnetheaven.com/UploadFile/dclark/StoredProceduresinVBdotNET04082005072716AM/StoredProceduresinVBdotNET.aspx

http://www.dbazine.com/sql/sql-articles/cook6

Instead of what is in these examples - cmd.CommandText = "StoredProcName", shouldn't it be cmd.CommandText = "dbo.StoredProcName"?

Kevin

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-11-12 : 15:42:18
while not strictly necessary, it's better to use the qualified name. I'll admit to being guilty of seldom doing it though
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-12 : 19:31:13
It's a performance recommendation, but the performance benefit is practically non-existant.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -