sql-server - 使用 Azure SQL Server 在其他表中插入

标签 sql-server azure azure-sql-database

我尝试使用其他表输入 INSERT INTO,但我有错误日志:

Mensagem 40515, Nível 15, Estado 1, Linha 18
Reference to database and/or server name in 'deletadosYY.dbo.deletadosCadastroTeste' is not supported in this version of SQL Server

我有可能这样做,因为我使用 azure 服务器,并且我需要在表之间更改信息。

我的 SQL 代码:

INSERT INTO deletadosYY.dbo.deletadosCadastroTeste VALUES (19,'Michael', 'Street Los Angelos', 25, '1998-12-25')

最佳答案

Azure SQL 数据库不支持 3+ 部分命名;它们是包含数据库,这意味着不允许引用数据库。

省略数据库名称并连接到连接字符串中的正确数据库(或者如果您位于 SSMS/ADS/等中,则切换数据库上下文)。那么你的陈述就很简单:

INSERT INTO dbo.deletadosCadastroTeste ({Your Column List goes here})
VALUES (19,'Michael', 'Street Los Angelos', 25, '1998-12-25');

关于sql-server - 使用 Azure SQL Server 在其他表中插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72659506/

相关文章:

azure - 是否可以通过编程方式从 Azure VM 获取 ASR Vault Id、结构和容器名称?

json - 使用 json 模板从 Visual Studio 部署 Azure VM?

azure-sql-database - 将 BACPAC 导入_现有_数据库

c# - 使用 WebDeploy 发布 Web 应用程序时如何在数据库上自动运行 Code First 迁移

c# - 如何在不使用 EF 的情况下连接到 ASP.NET Core Web API 中的数据库?

c# - 创建对 SQL Server C# 的查询

azure - 要导入以运行此 Powershell 命令的模块的名称

azure-sql-database - Azure SQL Advance 数据安全 (ADS) 和安全中心定价

sql - 如何在具有多个数据集的 SQL Server 报告中创建报告文本框聚合表达式

java - java中字符串转换日期或时间时转换失败