Reputation: 87
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 MSSQL 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?
Upvotes: 0
Views: 2525
Reputation: 96600
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.
Upvotes: 0
Reputation: 87
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.
Upvotes: 1