AnsweredAssumed Answered

Kreporter - MSSQL compatibility problem

Question asked by community-support on Jan 13, 2014
Latest reply on Jan 13, 2014 by community-support
i'm having trouble making a full rebuild in sugarcrm (6.4.3) since i installed KReporter (3.0.6)
This problem prevents me from creating new relationships in all modules because after each relationship creation there is an automatic rebuild and the relationship fails.
when i rebuild , i get this script to execute:

[CODE]
/* Table : kreportsnapshotsdata */
/*COLUMNS*/
/*MISMATCH WITH DATABASE - record_id -  ROW [name] => 'record_id'  [type] => 'real'  [len] => '4'  [required] => 'true'  */
/* VARDEF - record_id -  ROW[name] => 'record_id'  [type] => 'float'  [dbType] => 'double'  [len] => '8'  [required] => ''  */
  ALTER TABLE kreportsnapshotsdata DROP PRIMARY KEY  ALTER TABLE kreportsnapshotsdata ALTER COLUMN record_id float(8) NULL ;
   ALTER TABLE kreportsnapshotsdata ADD CONSTRAINT snapshot_data PRIMARY KEY (snapshot_id,record_id) ;
/* INDEXES */

[/CODE]

this script fails because there is no DROP PRIMARY KEY in mssql , there is only DROP CONSTRAINT.
[CODE]
  ALTER TABLE kreportsnapshotsdata DROP PRIMARY KEY
[/CODE]

i get the error:
[CODE]
Error altering column(s) record_id on table: kreportsnapshotsdata: Query Failed: ALTER TABLE kreportsnapshotsdata DROP PRIMARY KEY  ALTER TABLE kreportsnapshotsdata ALTER COLUMN record_id float(8) NULL
   ALTER TABLE kreportsnapshotsdata ADD CONSTRAINT snapshot_data PRIMARY KEY (snapshot_id,record_id) ::: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'PRIMARY'.
[/CODE]

I need to replace it with this, in order for the kreporter to support mssql:

[CODE]
ALTER TABLE kreportsnapshotsdata DROP CONSTRAINT snapshot_data;
[/CODE]

can someone tell me where is this query in the code?
'ALTER TABLE kreportsnapshotsdata DROP PRIMARY KEY'

where can i change the hardcoded query in order for the Kreporter to support mssql?

thank you.

(from rodnikosh)

Outcomes