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

MSSQL: Bug: Export grid row as INSERT statements generates wrong statement for bit columns

igitur posted 2 years ago in General

If I have a column defined as BIT and try to 'Export grid rows' and select' SQL INSERTs', the statements generate as follows:

INSERT INTO "LeadInReturn" ("Scheme_Id", "ReturnDate", "ReturnValue", "IsNettOfFees", "CompoundFrequency") VALUES (7, '2007-03-01 00:00:00.000', 0.079042207339953, b'1', 0);

However, a b`1` isn't a valid MSSQL conversion. It should be a pure 1.

igitur posted 2 years ago

I meant:

However, a b'1' isn't a valid MSSQL conversion. It should be a pure 1.

igitur posted 2 years ago

Should be simple fix?

ansgar posted 2 years ago

Yes, I'll check that. Thanks for the hint.

igitur posted 2 years ago

Please, ansgar ?

igitur posted 1 year ago

I hate to do this... but bump. This is surprisingly frustrating.

ansgar posted 1 year ago

r5073 should fix that.

igitur posted 1 year ago

r5073 should fix that.

Perfect, thanks.

Fred56 posted 1 year ago

The error is not corrected for Microsoft SQL in r7078.

igitur posted 1 year ago

The error is not corrected for Microsoft SQL in r7078.

I assume you mean r5078 ? Anyway, it works fine for me in r5078. What is the SQL that is generated for you?

Fred56 posted 1 year ago

I am using SQL Express 2012 HeidiSQL 9.3.0.5073. If in a table of data type BIT is, is set in the SET command = b'0 '.

1 attachment(s):
  • hilfe
Fred56 posted 1 year ago

I have updated to 9.3.0.5078 HeidiSQL, the same procedure

igitur posted 1 year ago

I am using SQL Express 2012 HeidiSQL 9.3.0.5073. If in a table of data type BIT is, is set in the SET command = b'0 '.

Huh? the SET keyword isn't valid in an INSERT command. What exactly are you doing to generate the script?

Fred56 posted 1 year ago

I do not generating. I want to change in a table a value. Then I get the error message 102 ... HeidiSQL then generates the SQL code UPDATE ... SET ... WHERE ... "Column 2" 0b'0'... I can not change data of the table.

Fred56 posted 1 year ago

Soory

I do not generating. I want to change in a table a value. Then I get the error message 102 ... HeidiSQL then generates the SQL code UPDATE ... SET ... WHERE ... "Column 2" = b'0'... I can not change data of the table.

Fred56 posted 1 year ago

I found the mistake. The SQL database always requires a key. Access makes their own key if none exists. HeidiSQL does not. Only the error message is a little bit irritating. Thanks for the helpful tips. Sorry for my bad English.

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