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

Heidi

sqluser posted 8 months ago in General

I have big problems in the Heidi datagrid.

I would like to change only 1 record But heide changes many data records !!! all records with field = '001' are changed

Heidi forms the SQL: UPDATE "PR1612000300"."dbo"."TBLWMS_UNI_TABLE" SET "WUNT_WMSDESCRIPTION"='1' WHERE
"WUNT_POS"='001';

but the Primary key is WUNT_NO and WUNT_POS

I think it is destroyed by many users many data

LutzT posted 8 months ago

This is no problem of HeidiSQL - it does what your queries says... Change your where statement - something like: WHERE WUNT_POS='001' AND WUNT_NO='defined_your_value_here'

sqluser posted 8 months ago

thanks for the answer and sory for my english

my SQL in the DATA GRID VIEWER = "wunt_no like '9%' the result = 10 Rows (pos. 001 - 010)

I change with one mouse click in the pos 001 one value z.B. wunt_sale = '100'

Heidi automatically generates the BAD SQL UPDATE "PR1612000300"."dbo"."TBLWMS_UNI_TABLE" SET "WUNT_SALE"='100' WHERE "WUNT_POS"='001';

and update in my Table 2000 Rows with wunt_sale = '100' this is a no-go for a Database Tool !!

ansgar posted 8 months ago

I assume you are on MSSQL, but you could have mentioned that in your posting.

The problem may be that HeidiSQL misdetects your primary key columns, and/or the MSSQL version is so old that HeidiSQL has problems with it. The query which is responsible for detecting keys is as follows:

SELECT C.CONSTRAINT_NAME, C.CONSTRAINT_TYPE, K.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K ON
    C.CONSTRAINT_NAME = K.CONSTRAINT_NAME
    AND K.TABLE_NAME='YOUR-TABLE-NAME'
    AND K.TABLE_SCHEMA='dbo'
WHERE C.CONSTRAINT_TYPE IN ('PRIMARY KEY', 'UNIQUE')
ORDER BY K.ORDINAL_POSITION;

Please check what that query returns for your table and post it here, preferably as Markdown Here export which is compatible to this forum.

sqluser posted 8 months ago

the Database = MSSQL vers. Microsoft SQL Server 2014 - 12.0.2000.8 (X64)

TABLE_CONSTRAINTS

CONSTRAINT_NAME CONSTRAINT_TYPE COLUMN_NAME
TBLWMS_UNI_TABLE_IDXPK PRIMARY KEY WUNT_NO
WUNT_GUID UNIQUE WUNT_GUID
TBLWMS_UNI_TABLE_IDXPK PRIMARY KEY WUNT_POS

i Think the Problem is the Unique key in the middle

sqluser posted 8 months ago

The last update did not fix the error with multiple indexes For security reasons, I will no longer use Heidi SQL.

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