SQL80001 Error in database project but not in SSMS 2016

  • I have a vs2015 database project set to Microsoft Azure SQLDatabase V12.  It builds but everytime I go view code, I get these errors

     

    WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE=[dbo].[xxxxxxx], DATA_CONSISTENCY_CHECK=ON, HISTORY_RETENTION_PERIOD=7 YEAR));

     

    SQL80001: Incorrect syntax near ','.  Expecting ')'.

    SQL80001: Incorrect syntax near 'HISTORY_RETENTION_PERIOD'.

     

    I can copy the whole create table DDL statement with theclause above and execute in SSMS without a syntax complaint.

     

    Has anyone encountered these errors?  What can be doneabout them?  The project opens with 0 errors but when you go to view code,the errors will pop.  The project still builds and can be publishednormally.

    Thank you!

  • Just curious, but within VS 2015, can you set the version of SQL Server that a given project applies to?    Just thinking about the possibility that the syntax checker might be expecting SQL 2016 syntax and maybe there was a change?    If that's not the problem, then I'm stumped.....

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • Yes,, under Project Properties,  there is a target platform dropdown that goes from SQL Server 2005 to Microsoft Azure SQL Database V12.  I set Microsoft Azure SQL Database V12.
    Setting to sql server 2016 results errors right away even without my going into View code.
    With V12, no errors until I attempt to view code.  Thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply