简体   繁体   中英

Why can't I open this table in SQL Server Management Studio?

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:

Error Source: 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.

Does anyone know what is causing this?

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM