2

A SQL Server Project in Visual Studio 2015 with stored procedures that use the phrase AT TIME ZONE does not build, targeting SQL Azure V12.

What can I do to get around or fix this?

Sentinel
  • 3,582
  • 1
  • 30
  • 44
  • Which version of Azure you are on .. and what are the errors you are getting ...? – TheGameiswar May 23 '16 at 09:17
  • V12 db, problem is a simple 'syntax error near AT' . SQL Server Project will not compile AT TIME ZONE. – Sentinel May 23 '16 at 09:20
  • SQL Azure supports At time Zone.Can you share code you are using – TheGameiswar May 23 '16 at 09:21
  • SQL Azure definitely supports it, the SP is running in Azure without error. The problem is that after I import this into a 'SQL Server Project' in Visual Studio 2015, it can not be then deployed elsewhere. The project does not compile. – Sentinel May 23 '16 at 09:25
  • I ran into the same error, reversed engineer an Azure Database V12 with stored procedures which contained the new SQL Server syntax "AT TIME ZONE". Visual Studio 2015 SQL Project compile results in SQL46010: Incorrect syntax near AT. – Carl Prothman Jan 06 '17 at 03:52
  • Fix it, just needed to open up the SQL Server Project and select SQL Server 2016 (or Microsoft Azure SQL Database V12) and it compiles with no issues. – Carl Prothman Jan 06 '17 at 04:03
  • Interesting I was targeting V12 and would not compile. Since updated VS, so will try again later. – Sentinel Jan 06 '17 at 11:45

1 Answers1

2

facing same issue with "AT TIME ZONE" in Visual Studio 2015. By some analysis found that "AT TIME ZONE" will work only for SQL Serevr 2016. By changing property Target Platform to "SQL Server 2016" issue got resolved.