SQL execution error when trying to open table with many cols

Posted on 2007-11-27
Last Modified: 2008-02-01
When trying to open a table (that someone else created) with a large number of cols SQLServer 2005 I get the following error:
Error Source: Microsoft.VisualStudio.DataTools
Exception has been thrown by the target of an invocation
I read somewhere the row length is 8060 - I guess this is the cause... Is there a workaround?

Question by:acdagirl
  • 3
  • 3
LVL 18

Expert Comment

ID: 20358480
Try running the code in Code Snippet.
I doubt there is some SQL error here. You might need to look for help in the zones for Visual Studio or the programming language you are using ...

If you can give us the table def, we can calculate the column length (as you can do yourself of course) but when you try to create a table with a record def that is too long, you will get an error and you won't be able to create the table. So I have strong indication that the programming language or tool you are using is having some problems with the number of column. Not SQL Server ...

Hope this helps ...

select  count(*)

from    <Table>

-- should return only the number of records in the table.

select  *

from    <Table>

where   1 = 2

-- should return only the column names.

select  <column>

from    <Table>

-- select only one single column, not the whole (unknown) number of columns.


Open in new window


Author Comment

ID: 20358817
i'm opening the table in enterprise manager - there is not other tool here.
LVL 18

Expert Comment

ID: 20361755
what about the select statements ?
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.


Author Comment

ID: 20365036
if I do a range it's ok, if I try to select all it fails with the same error.
LVL 18

Accepted Solution

Yveau earned 500 total points
ID: 20366425
Yep ... the SSMS is also just an application. The datagrid controls which are used for the SSMS also have there boundaries ... just have to live with it. You might want to make a case with MS for this ...
I've noticed these issues as well with several sort of operations on larger tables ...

But in the end ... scripting is always better ... and has never failed me :-)

Hope this helps ...

Author Comment

ID: 20366526
ok thanks

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server Select on LT running Totals 6 63
SQL Server 2012 express 24 36
SQL 2005 - Memory Table Column Names 11 69
Urgent help needed! Unable to to paste in query designer 29 37
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Sending a Secure fax is easy with eFax Corporate ( First, just open a new email message. In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With  eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now