views:

740

answers:

2

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?

+1  A: 

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.

James Winans
Only 800???? What happened to normalisation?
chrissie1
If you really need 800 columns you may consider using sparse columns (SQLServer 2008)
kristof
A: 

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.

HLGEM