Possible to set default schema from connection string?

后端 未结 4 921
走了就别回头了
走了就别回头了 2020-11-29 09:54

With SQL Server 2005 and 2008 is it possible to set the default schema from the connection string? It\'d be a lot easier if we didn\'t have to manually set the schema with S

4条回答
  •  遥遥无期
    2020-11-29 10:43

    You set the default schema based on the user who is logging in via the connection, not the connection itself.

    ALTER USER Mary51 WITH DEFAULT_SCHEMA = Purchasing;
    

    Reference:

    • ALTER USER

提交回复
热议问题