为什么我不能在SQL Server Management Studio中打开此表?

时间:2022-03-28 15:25:25

I created a couple of tables procedurally via C# named something like [MyTableOneCustom0] and [MyTableTwoCustom0]. When I try to return all of the values from these tables via "Open Table" in MS SQL Server Management Studio, I receive the following error:

我通过C#在程序上创建了几个表,名为[MyTableOneCustom0]和[MyTableTwoCustom0]。当我尝试通过MS SQL Server Management Studio中的“打开表”返回这些表中的所有值时,收到以下错误:

Error Source: Microsoft.VisualStudio.DataTools

错误来源:Microsoft.VisualStudio.DataTools

Error Message: Exception has been thrown by the target of an invocation.

错误消息:调用目标已抛出异常。

However, I can still bring up all of the data via a SELECT * statement.

但是,我仍然可以通过SELECT *语句调出所有数据。

Does anyone know what is causing this?

有谁知道是什么原因造成的?

2 个解决方案

#1


1  

Based on a similar post loacated at at Egg Head Cafe, it looks like the Management Studio will thrown an exception if there are too many columns included explicitly in the query. Select * returns them implicitly, so there doesn't seem to be an issue.

基于在Egg Head Cafe上发布的类似帖子,如果查询中明确包含太多列,则看起来Management Studio将抛出异常。选择*隐式返回它们,所以似乎没有问题。

I have over 800 columns in this table, so I'm sure this is the problem.

我在这张表中有超过800列,所以我确定这是问题所在。

#2


0  

I hesitate to ask, but normally you would not want 800 or columns in a database, so why did you do this? Given how databases store information you are possibly creating many problems for yourself with a design like that in terms of data retrieval and storage. How many bytes of data woudl a full row have? You know there is a limit to the number of bytes of data that can be stored in a row. You could be setting yourself up for issues entering data when a row exceeds those limits. It might be best to break into separate tables even if there is a one-to-one relationship. Read in BOL about data pages and how data is stored to understand why this concerns me.

我犹豫不决,但通常你不会想要数据库中的800或列,所以你为什么这样做?鉴于数据库如何存储信息,您可能会在数据检索和存储方面为您自己创建许多问题。整行有多少字节的数据?您知道可以存储在一行中的数据字节数有限制。当行超过这些限制时,您可能会自行设置输入数据的问题。即使存在一对一的关系,最好分成单独的表。在BOL中读取有关数据页面以及数据存储方式的信息,以了解为什么这会影响我。

#1


1  

Based on a similar post loacated at at Egg Head Cafe, it looks like the Management Studio will thrown an exception if there are too many columns included explicitly in the query. Select * returns them implicitly, so there doesn't seem to be an issue.

基于在Egg Head Cafe上发布的类似帖子,如果查询中明确包含太多列,则看起来Management Studio将抛出异常。选择*隐式返回它们,所以似乎没有问题。

I have over 800 columns in this table, so I'm sure this is the problem.

我在这张表中有超过800列,所以我确定这是问题所在。

#2


0  

I hesitate to ask, but normally you would not want 800 or columns in a database, so why did you do this? Given how databases store information you are possibly creating many problems for yourself with a design like that in terms of data retrieval and storage. How many bytes of data woudl a full row have? You know there is a limit to the number of bytes of data that can be stored in a row. You could be setting yourself up for issues entering data when a row exceeds those limits. It might be best to break into separate tables even if there is a one-to-one relationship. Read in BOL about data pages and how data is stored to understand why this concerns me.

我犹豫不决,但通常你不会想要数据库中的800或列,所以你为什么这样做?鉴于数据库如何存储信息,您可能会在数据检索和存储方面为您自己创建许多问题。整行有多少字节的数据?您知道可以存储在一行中的数据字节数有限制。当行超过这些限制时,您可能会自行设置输入数据的问题。即使存在一对一的关系,最好分成单独的表。在BOL中读取有关数据页面以及数据存储方式的信息,以了解为什么这会影响我。