更改SQL Azure登录的默认数据库 [英] Changing the default database for a SQL Azure login

查看:112
本文介绍了更改SQL Azure登录的默认数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改登录的默认数据库,以支持可以访问SQL Azure但不允许轻易更改连接字符串的软件.看来SQL Azure默认为master数据库.

I would like to change the default database for a login to support software that can access SQL Azure but does not allow easy alteration of a connection string. It appears that SQL Azure defaults to the master database.

我已经考虑过:

  • 存储过程.我找不到执行此操作的存储过程(据我所知,sp_defaultdb在SQL Azure中未实现)

  • Stored procedures. I can't find a stored procedure that does this (sp_defaultdb is not implemented in SQL Azure as far as I can tell)

更改登录名. ALTER LOGIN不允许使用DEFAULT_DATABASE选项.

Alter Login. ALTER LOGIN does not permit the DEFAULT_DATABASE option.

SSMS. SSMS似乎不允许通过SQL Azure界面进行太多用户控制.

SSMS. SSMS doesn't seem to allow much user control through the interface for SQL Azure.

想法?

推荐答案

连接字符串:

Server=tcp:[serverName].database.windows.net;Database=myDataBase;User ID=[LoginForDb]@[serverName];Password=myPassword;Trusted_Connection=False;Encrypt=True;

在连接字符串处写入数据库"属性时,可以更改连接默认数据库.

You can change connect default database, when you write 'Database' property at connection string.

SSMS已连接到数据库框,该框位于锥框对话框中的选项->第二"选项卡上.

SSMS is connect to database box which is option->secont tab at conecct dialog.

这篇关于更改SQL Azure登录的默认数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆