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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 performance

Author  Topic 

fmardani
Constraint Violating Yak Guru

433 Posts

Posted - 2004-11-11 : 06:51:00
in a select query in stored procedures, is it quicker to use databasename.dbo.tablename instead of tablename?
Thanks

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2004-11-11 : 07:49:23
It takes a lot longer to type! ;)

BOL says to use 3 or 4 part names if the referenced table is outside of the current DB or server, it doesnt say anything about performance

Not sure whether aliasing helps

Andy
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-11-11 : 08:45:45
yes....dbengine doesn't have to spend time checking what database the table is in ...and/or what owner the table is owned by before including it in the calculation/query...minor drop in perf...but when milliseconds count every small thing helps
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-11-11 : 10:41:21
If you don't put "dbo." in front of the table names and someone creates a table with a non-dbo owner, matching your tablename, then you may not get the result you were expecting!

Kristen
Go to Top of Page
   

- Advertisement -