Skip to content

Heidi SQL does not properly update records using a field with datatype bit #264

@altmvogi

Description

@altmvogi

Steps to reproduce this issue

  1. Step 1; Create a simple table with "ID" (int); "text(varchar50)"; "bit type" (bit)
  2. Step 2; Fill the table with 2 records according their data types.
  3. Step N; Update the text with another text and press the "post" button
  4. Then I get...the error "SQL Error (102): Incorrect syntax near '0'

Current behavior

the problem is the generated SQL does not conform with the SQL standards therefor the error appears.
Sample
UPDATE TOP(1) "Checkmarx"."dbo"."bit test table"
SET "text"='test5'
WHERE "ID"=4
AND "text"='test4'
AND "bity type"=b'0';
/* SQL Error (102): Incorrect syntax near '0'. */
the reason is because the "bity type"=b'0' is incorrect. the "b" should not be there!

Expected behavior

UPDATE TOP(1) "Checkmarx"."dbo"."bit test table"
SET "text"='test5'
WHERE "ID"=4
AND "text"='test4'
AND "bity type"='0';
This is the manually corrected syntax without the "b". this can be run normally in the "query" option and the text is updated correctly to 'test5'

Possible solution

change the tool so it does create the correct SQL syntax for Microsoft SQL server so this error disappears. I might look into the code later on to provide more details if needed.

Environment

  • HeidiSQL version:

version 9.5.0.5278 latest built

  • Database system and version:

I am not sure but it looks like the syntax might be right for another Database than Microsoft SQL therefore it's relevant to mention the DB.

latest built of MSSQL server 2012 built 11.0.7469.6

  • Operating system:

not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefective behaviour in HeidiSQLconfirmedIssue verified by project membernettype-mssqlSQL Server specific issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions