Column name or number of supplied values does not match table definition(列名或提供的值数量与表定义不匹配)
问题描述
在 SQL Server 中,我尝试使用以下查询将值从一个表插入到另一个表:
In the SQL Server, I am trying to insert values from one table to another by using the below query:
delete from tblTable1
insert into tblTable1 select * from tblTable1_Link
我收到以下错误:
列名或提供的值数量与表定义不匹配.
Column name or number of supplied values does not match table definition.
我确信这两个表具有相同的结构、相同的列名和相同的数据类型.
I am sure that both the tables have the same structure, same column names and same data types.
推荐答案
它们的结构不一样...我可以保证它们是不同的
They don't have the same structure... I can guarantee they are different
我知道你已经创建了它... 数据库中已经有一个名为 'tbltable1' 的对象
I know you've already created it... There is already an object named ‘tbltable1’ in the database
您可能想要的是这个(这也解决了您的其他问题):
What you may want is this (which also fixes your other issue):
Drop table tblTable1
select * into tblTable1 from tblTable1_Link
这篇关于列名或提供的值数量与表定义不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:列名或提供的值数量与表定义不匹配
基础教程推荐
- 在 SQL 中连接多个表 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 无法解决整理冲突 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
