标题:连接到服务器
无法连接到 tcp:ohimryXusa.database.windows.net,1433。
附加信息:
你好,
我有一个 SQL Azure 数据库。该数据库有一个我想用来访问它的用户名/登录名。当我尝试通过 SQL Server Database Management Studio 连接到数据库时,收到一条错误消息:
Cannot open database "master" requested by the login. The login failed.
Login failed for user 'mydbusername'.
This session has been assigned a tracing ID of '00000000-0000-0000-0000-000000000000'. Provide this tracing ID to customer support when you need assistance. (Microsoft SQL Server, Error: 4060)
Run Code Online (Sandbox Code Playgroud)
我有其他登录名可以成功连接到数据库。我尝试在数据库上执行以下命令,以确保存在用户:
CREATE USER mydbusername
Run Code Online (Sandbox Code Playgroud)
我收到一条错误消息:
Msg 15023, Level 16, State 1, Line 1
User, group, or role 'mydbusername' already exists in the current …Run Code Online (Sandbox Code Playgroud) 有没有办法使用 REST API 或 Azure 管理库在 SQL Azure 数据库上创建执行存储过程?
我在这里检查了 Azure SQL 数据库的操作http://msdn.microsoft.com/en-us/library/azure/dn505719.aspx和 .NET 的管理库在这里http://msdn.microsoft.com/en-us/ Library/azure/dn602775(v=azure.11).aspx,我没有看到任何选项。
我刚刚将.bacpac文件恢复到本地 SQL Server 实例 (64b v12.0.4213),备份来自 azure sql 实例。
由于 OOM 异常,它失败了几次。我关闭了机器上的所有内容,在恢复结束时,SQL Server 服务实例消耗了 700MB 文件中的 13GB 内存!
幸运的是,恢复完成了,但似乎内存没有被释放/垃圾收集。当我写这篇文章时,它的内存仍然是 12GB。
这是一个已知问题吗?有什么方法可以恢复.bacpac并选择要忽略的表吗?您可以通过正常的数据恢复来完成此操作,最令人反感的表是 dbo.[Logs] 表、obvs。
是否可以在本地 SQL Server 实例和 Azure SQL 数据库之间进行事务。
我有以下测试用例。
public class TransactionsTest
{
[Fact]
public void Test1()
{
var premisesDatabaseContext = new OnPremisesDatabaseContext();
var azureSQLDatabaseContext = new AzureSQLDatabaseContext();
using (TransactionScope scope = new TransactionScope())
{
premisesDatabaseContext.Database.Connection.Open();
azureSQLDatabaseContext.Database.Connection.Open();
scope.Complete();
}
}
[Fact]
public void Test2()
{
var premisesDatabaseContext = new OnPremisesDatabaseContext();
var azureSQLDatabaseContext = new AzureSQLDatabaseContext();
using (TransactionScope scope = new TransactionScope())
{
azureSQLDatabaseContext.Database.Connection.Open();
premisesDatabaseContext.Database.Connection.Open();
scope.Complete();
}
}
}
Run Code Online (Sandbox Code Playgroud)
这看起来很简单。但是当我打开第二个连接时,两个测试用例都失败并出现不同的错误。
这是错误的详细信息。
// TEST 1
System.Reflection.TargetInvocationException:
Exception has been thrown by the target …Run Code Online (Sandbox Code Playgroud) 用户在 Azure SQL Server 中运行批量插入命令时遇到以下错误。我使用的是 Azure SQL Server 而不是 SQL Sever。大多数与大容量插入授予权限相关的命令在 Azure SQL Server 中不起作用。
错误
You do not have permission to use the bulk load statement.
Run Code Online (Sandbox Code Playgroud)
在 Azure SQL Server 中尝试添加用户的命令
EXEC sp_addrolemember 'db_ddladmin', 'testuser';
ALTER SERVER ROLE [bulkadmin] ADD MEMBER testuser
GRANT ADMINISTER BULK OPERATIONS TO testuser
Run Code Online (Sandbox Code Playgroud)
错误
Msg 40520, Level 16, State 1, Line 5
Securable class 'server' not supported in this version of SQL Server.
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助。
我正在尝试使用 pyodbc 连接到我的 Azure SQL 数据库。我使用的 azure 帐户的用户名是 xxxxxx@student.bham.ac.uk(我的大学帐户)。当我尝试连接到数据库时,出现错误
Cannot open server "student.bham.ac.uk" requested by the login. The login failed. (40532).
我使用的凭据是正确的。该错误让我认为它可能会混淆我对数据库服务器的登录?这个错误是什么意思,我该如何解决这个问题?
我想用 C# 编写代码,以编程方式创建 Azure SQL 数据库并将其添加到现有的弹性池中。我查看了 Elastic Database Client Library,但它不处理数据库的创建,只将现有数据库注册为分片,我肯定会使用它。
是否可以使用像 SqlClient 这样简单的东西来创建数据库,或者这可以通过使用 Azure SQL 管理 SDK 或其他一些选项来完成?
我们有一个Visual Studio 数据库项目,正尝试将其迁移到 Azure SQL 数据库。我们的一些视图使用Azure SQL 数据库支持的AT TIME ZONE,但是当我在项目属性中将数据库目标平台切换到 Microsoft Azure SQL 数据库时,它无法构建并出现错误:
错误:SQL46010:TIME 附近的语法不正确。
我已直接连接到 Azure 中的数据库,并且可以使用AT TIME ZONE,但无法DACPAC从项目中创建或发布文件。
This SO 答案建议将目标切换到 SQL Server 2016,但随后您无法将其部署DACPAC到 Azure。它会给出错误
将 SQL Server 2016 指定为目标平台的项目无法发布到 Microsoft Azure SQL Database v12。
从 Visual Studio 或命令行使用sqlpackage.exe. (与所有目标相同)。
这似乎是 Visual Studio Data Tools 中长期存在的错误,因此其他人肯定也遇到过它。有人有解决方法或建议吗?
我和我的团队正在尝试从打开了列级加密的数据库(Azure SQL)解密值;证书存储在密钥保管库中。
预期结果:
var someLinqQuery = _contex.Users.First();
someLinqQuery.SSN = "000-00-0000";
Run Code Online (Sandbox Code Playgroud)
实际结果:
var someLinqQuery = _context.Users.First();
someLinqQuery.SSN = "the var binary (encrypted) version of the ssn";
Run Code Online (Sandbox Code Playgroud)
FWIW,这在使用原始 sql 时可以正常工作。但我们希望选择不这样做,并加密更多数据。
我们这里还有天蓝色的密钥库代码:
//Key Vault Code Below
private static ClientCredential _clientCredential;
public static void InitializeAzureKeyVaultProvider()
{
if (!isActivated)
{
_clientCredential = new ClientCredential(_applicationId, _clientKey);
SqlColumnEncryptionAzureKeyVaultProvider azureKeyVaultProvider = new SqlColumnEncryptionAzureKeyVaultProvider(GetToken);
Dictionary<string, SqlColumnEncryptionKeyStoreProvider> providers = new Dictionary<string, SqlColumnEncryptionKeyStoreProvider>
{
{ SqlColumnEncryptionAzureKeyVaultProvider.ProviderName, azureKeyVaultProvider }
};
SqlConnection.RegisterColumnEncryptionKeyStoreProviders(providers);
isActivated = true;
}
}
public static async Task<string> GetToken(string authority, …Run Code Online (Sandbox Code Playgroud) linq encryption entity-framework-core .net-core azure-sql-database
我想通过 Terraform 在 Azure Sql 的无服务器计算层中创建新数据库。是否可以创建?如果是的话,你能告诉我如何创建它吗?