distal-attribute
distal-attribute
distal-attribute
distal-attribute

Cannot see full error messages in SQL Server

User, date Message
Written by kalvaro
1 year ago
Category: Running SQL scripts
587 posts since Thu, 29 Nov 07
Given the following code:

CREATE TABLE foo (
foo_id INT NOT NULL
PRIMARY KEY (foo_id)
);

INSERT INTO foo (foo_id) VALUES (1);



If you run a query that triggers an error, e.g.:

INSERT INTO foo (foo_id) VALUES (1);



... all you see in HeidiSQL is this:

SQL Error (3621): Se terminó la instrucción.



In Microsoft SQL Server Management Studio the error is this:

Mens. 2627, Nivel 14, Estado 1, Línea 1
Infracción de la restricción PRIMARY KEY 'PK__foo__650E807E'. No se puede insertar una clave duplicada en el objeto 'dbo.foo'.
Se terminó la instrucción.



HeidiSQL only displays the last line and discards the relevant bit (duplicate PK).
Written by ansgar
1 year ago
4936 posts since Fri, 07 Apr 06
Can confirm that. There are two sources where to look at for an error message. The first one is TAdoConnection.Errors, which is currently processed. The second one is the EOleException message which for example pops up after firing a faulty query. Sometimes both contain the same text, for example in an attempt to connect with wrong credentials. So, the fix will be to take the exception message into the error dialog only if TAdoConnection.Errors does not already contains that text.

Google Code SVN seems to be offline right now, so it may take some time to commit. See https://code.google.com/p/support/issues/detail?id=30749 .
Written by ansgar
1 year ago
4936 posts since Fri, 07 Apr 06
Done, please test r4406.
Written by kalvaro
1 year ago
587 posts since Thu, 29 Nov 07
Much better now, thank you!

Being picky... I have the impression that there're some carriage returns that are being stripped out:

Written by ansgar
1 year ago
4936 posts since Fri, 07 Apr 06
You mean, because Management Studio has a carriage return between those two messages? Well, the two messages are joined together with a space only in HeidiSQL, but I guess it'll be more readable if we use a linefeed.
Written by kalvaro
1 year ago
587 posts since Thu, 29 Nov 07
I mean that Error de INSERT (INSERT error) and Se terminó la instrucción (Statement completed) are different sentences but the first one doesn't end with period so it's confusing.
Written by kalvaro
1 year ago
587 posts since Thu, 29 Nov 07
Or, just seen http://code.google.com/p/heidisql/source/detail?r=4408. Again, thank you!
 

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