All the tables in my schema have a prefix of dbo. Now in my sql statements, I don't like using dbo.tablename all the time. Any workarounds or configuration changes?
views:
887answers:
4How can I remove the dbo prefix from my table names when I write my sql statements in SQL Server?
I think the user in which you connect have to belong to dbo schema, and then you won't have to type the prefix, it will infer it from the schemas the user belong.
Actually you should leave those dbo. statements because you SQL will be faster since the optimizer doesn't have to lookup the schema
Check out this link also Performance Impact of Procedure Calls without Owner Qualification
It's actually beneficial to leave the dbo. prefix in place - after all, in SQL Server, you could have several schemas (the "dbo." thingie) with the same table name, e.g. dbo.MyTable, joe.MyTable, frank.MyTable.
If you then issue a SELECT (list of fields) FROM MyTable, SQL Server has to first figure out which of the "MyTable" tables you really mean --> this costs time, specifying right off the bat you want "dbo.MyTable" will SAVE you time.
OK, not a lot on a single query - but SELECT queries are QUITE frequent and it all adds up!
Marc
Dennis is right dbo is more efficient.
Honestly, how hard is it really to use .dbo. in place of.. ?