Copying databases from PROD back to TEST/STAGE and then further back down to a developer box is a normal routine. It helps in debugging issues found in Production, and is a healthy task to do from time to time regardless.

Microsoft Documentation team has done an absolute phenomenal job with their details on how to copy from Azure SQL to SQL Server or visa versa.

Some of our customers however are experiencing an error while others are not. Incase you get the vague 'Invalid Syntax' error as seen below. This is due to dynamic SQL which has some kind of space in it likely, which can be corrected by using brackets [ ]. Please make the following changes.

Source Problem:



Corrective Action A:



Corrective Action B:

