Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sql-server

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?

like image 381
Srikar Doddi Avatar asked Apr 20 '09 18:04

Srikar Doddi


People also ask

Why do table names in SQL Server start with DBO?

dbo is the default schema in SQL Server. You can create your own schemas to allow you to better manage your object namespace. As a best practice, I always add the "dbo." prefix even though it is not necessary. Most of the time in SQL it's good to be explicit.

What is DBO in SQL Server table name?

The dbo schema is the default schema of every database. By default, users created with the CREATE USER Transact-SQL command have dbo as their default schema. The dbo schema is owned by the dbo user account. Users who are assigned the dbo as default schema don't inherit the permissions of the dbo user account.

What is DBO in SQL Server query?

In SQL Server, the dbo or Database Owner is a server-level principal that has full access to the owned database. Microsoft's best practices recommend creating a discrete user, either an Active Directory domain user or group, or a SQL Server Authentication user, to use as the database owner.


1 Answers

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

like image 130
SQLMenace Avatar answered Oct 06 '22 00:10

SQLMenace