crashed when trying to display table contents from a SQL Server 2000 database

olliejones posted 4 years ago in General
HeidiSQL crashed when I tried to display contents from a table in a SQL Server 2000 database (yeah, I know! trying to move it into the 21st century!) and so I attach the bug report.

It's here: https://dl.dropboxusercontent.com/u/6625297/bugreport.txt

(The forum webapp refused to let me attach it, saying "Error: File #0: Invalid file format: text/x-pascal. Allowed types: jpg, png, gif, txt, html.")


Thanks for all you do!
ansgar posted 4 years ago
The relevant message from that callstack is:
Invalid object name 'sys.partitions'

The query which is not working correctly is this one:
SELECT SUM(rows) FROM sys.partitions
WHERE
index_id IN (0, 1)
AND object_id = object_id("yourdb"."yourschema"."yourtable")


I can add a version conditional for older MSSQL versions like 2000. But you will have to post a working example here, as I'm not very familiar with these old servers.
ansgar posted 4 years ago
Perhaps we can just use a
SELECT COUNT(*) FROM "yourtable"
if that's good and fast enough?
ansgar posted 4 years ago
Should be finally fixed in r4941, by falling back to SELECT COUNT(*) on MSSQL 2000.
olliejones posted 4 years ago
This is excellent, thanks.
phiter posted 12 months ago

Should be finally fixed in r4941, by falling back to SELECT COUNT(*) on MSSQL 2000.

Would it be possible to download this revision as of today?

The last available version is r5215

ansgar posted 12 months ago

Well, the code is still in the latest build, so you should be fine when using the latest update.

phiter posted 12 months ago

Yeah, I've tried but it doesn't work at all with SQL Server 2000.

Errors with sysobjects. I can't see the table data and schema. Queries run fine though.

phiter posted 12 months ago

Here is the error:

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG='mydb' AND TABLE_NAME='mytable';

SELECT c.name AS "column", prop.value AS "comment" FROM sys.extended_properties AS prop INNER JOIN sys.all_objects o ON prop.major_id = o.object_id INNER JOIN sys.schemas s ON o.schema_id = s.schema_id INNER JOIN sys.columns AS c ON prop.major_id = c.object_id AND prop.minor_id = c.column_id WHERE prop.name='MS_Description' AND s.name='' AND o.name='mytable';

/* SQL Error (208): Invalid object name 'sys.extended_properties'
Invalid object name 'sys.columns'. */
/* SQL Error (208): Invalid object name 'sys.extended_properties'
Invalid object name 'sys.columns'. */
ansgar posted 12 months ago

I can add a version conditional here, but I need to know the minimum version of MSSQL supporting that sys.extended_properties table. That query is used to retrieve column comments, which are not vital for the table editor - it also works without them.

ansgar posted 12 months ago

You should file an issue in the tracker.

phiter posted 12 months ago

I'll put it up on GitHub now.

Please login to leave a reply, or register at first.