We have a Visual Studio Database Project that we are trying to move to Azure SQL Database. Some of our views use AT TIME ZONE which is supported in Azure SQL Database, but when I switch the database Target Platform to Microsoft Azure SQL Database in the project properties, it fails to build with error:
Error: SQL46010: Incorrect syntax near TIME.
I have connected directly to the database in Azure and I can use AT TIME ZONE
, but I cannot create or publish a DACPAC
file from my project.
This SO answer suggests switching the target to SQL Server 2016, but then you cannot deploy the DACPAC
to Azure. It will give the error
A project which specifies SQL Server 2016 as the target platform cannot be published to Microsoft Azure SQL Database v12.
when publishing from Visual Studio or the command line with sqlpackage.exe
. (Same with all targets).
This seems like a long-standing bug in Visual Studio Data Tools so others must have run into it. Does anyone have a workaround or suggestions?