每个表中的列名必须是唯一的。表'Tab'中的列名'产品描述'被多次指定。 [英] Column names in each table must be unique. Column name 'Product Description' in table 'Tab' is specified more than once.

查看:1431
本文介绍了每个表中的列名必须是唯一的。表'Tab'中的列名'产品描述'被多次指定。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在提取数据INTO DatabaseName..Tab并且我收到以下错误。 

I'm pulling a data INTO DatabaseName..Tab and I'm getting below error. 

(15行(s)受影响)



(21196行受影响)

Msg 2705,Level 16,State 3,Line 190

列名每个表必须是唯一的。表''Tab'中的列名"产品描述"被多次指定。

(15 row(s) affected)

(21196 row(s) affected)
Msg 2705, Level 16, State 3, Line 190
Column names in each table must be unique. Column name 'Product Description' in table 'Tab' is specified more than once.

当我尝试 使用select * from  DatabaseName..Tab来提取数据。这一切都是错误的。 

when I try to  pull the data with select * from DatabaseName..Tab. This all error are getting. 

但我可以在没有"INTO DatabaseName..Tab"的情况下提取数据。在脚本中。 

But I can able to pull the data without "INTO DatabaseName..Tab" in the script. 

我可以解决这个问题吗? 

Is there way I can fix this? 

如果我对我的描述有任何疑惑,请道歉。如果需要,脚本可以分享。 

Apologize if I made any confusion on my description. Script can be share if needed. 

谢谢

推荐答案

所以你已经发现了使用"*"的原因而不是实际的列列表是一个问题。所以简短的回答是正式定义要包含的列(并存储在表中)并确保在该列表中不包含重复的列
名称(或至少为它们提供不同的别名以允许创建新表格。 

So you have discovered why using "*" instead of an actual column list is a problem. So the short answer is to formally define which columns you want to include (and store in your table) and to make certain that you do not include duplicate column names in that list (or at least give them different aliases to allow the creation of the new table). 

您忘记包含的是您使用的导致错误的完整查询。您的查询几乎可以确定连接表,并且至少有两个不同的表具有提到的名称。如果不是这种情况,那么您需要发布脚本。 

What you forgot to include is the complete query you use that causes the error. It is almost a certainty that your query joins tables and that at least 2 different tables have the mentioned name. If that is not the case then you will need to post the script. 


这篇关于每个表中的列名必须是唯一的。表'Tab'中的列名'产品描述'被多次指定。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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