MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

FK extract script fails if FK goes over multiple columns #83020

Open upstream-dmahlberg opened 2 years ago

upstream-dmahlberg commented 2 years ago

In Step 4 of the Migrate the sample schema section of this page, a lengthy SQL statement is used to extract the statements used to drop and re-add the Foreign Keys from the destination database. Sadly, re-adding the FKs failes if the FKs go over multiple columns:

ALTER TABLE <table> ADD CONSTRAINT <fk_name> FOREIGN KEY ("column1,column2,column3") should really be

ALTER TABLE <table> ADD CONSTRAINT <fk_name> FOREIGN KEY ("column1","column2","column3") since the former statements throws an SQL-Exception like

ERROR: "column "column1,column2,column3" referenced in foreign key constraint does not exist".


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

AnuragSharma-MSFT commented 2 years ago

@upstream-dmahlberg Thank you for the feedback. We are actively investigating and will get back to you soon.

KalyanChanumolu-MSFT commented 2 years ago

@upstream-dmahlberg This is being assigned to the content author to evaluate and update the documentation as appropriate.