PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WD22 - sqlserver foerign key constraints
WD22 - sqlserver foerign key constraints
Débuté par Arie, 16 jan. 2018 21:48 - 2 réponses
Posté le 16 janvier 2018 - 21:48
Hi,

I noticed that when creating tables using HCreationIfNotFound() the foreign key constraints (integrity constraints) are not created. I'm talking about mssql server, nor with the regular driver nor with the native driver.

When I go into the analysis there is an option to generate an database-create-sql script. Here we have an option to create constraints as well and yes it generates the necessary scripts. But that makes live a bit more complex, whenever I add a new table.

Is this by design or 'as expected' or do I miss something?
Posté le 16 janvier 2018 - 23:10
Hi Arie,

AFAIK, if yo are using an external SQL DB, you are supposed to use the script to create it originally, then do the changes in the DB by hand and get the new structures from it in your analysis.

Now it is POSSIBLE that the whole thing can be done with the hcreationifNotFOund -IF- you are using a native access and this is supported in it, but I kind of doubt it. If that was the case, they probably wouldn't have bothered with the SQm script at all...

Missing HF yet? :-)

Best regards
Posté le 17 janvier 2018 - 00:19
Arie,

I highly recommend Navicat for managing your external DB's. It's an investment but will save you an incredible amount of time.

I keep a copy of my DB called "baseline" which is where I make all my initial changes when making DB updates. I then use Navicat's compare function to auto generate the scripts to update the other databases.

This is particularly helpful if you are selling a commercial piece of software to multiple clients.

Steve