How can I remove the dbo prefix from my table names when I write my sql statements in SQL Server?

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


The bounty question isn't exactly the original question.

The current answers do not contain enough detail.

None of the answers actually address the question of how to remove the dbo prefix or change it to something else.

dbo is the schema. You can't remove the schema from a table. You can alter it. There are many examples. Here is one: How do I move a table into a schema in T-SQL.

Tags:

Sql Server