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

前端 未结 6 1509
一向
一向 2020-12-15 07:51

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?

6条回答
  •  粉色の甜心
    2020-12-15 08:44

    just like this, if all your table are in dbo schema

    use mydatabase
    go
    select * from mytable
    

    if you have multiple databases you can do it too:

    select * from mydatabase..mytable
    

提交回复
热议问题