0

I have a SQL Server database project which is set to target SQL Server 2008 as its Target Platform.

Image showing SQL Server 2008 is target platform

In one of my stored procedures, I have code as follows:

DECLARE @yearEnd date
SET    @yearEnd = datefromparts(@reportingYear,8,31)

The particular stored procedure uses the datefromparts() function, which was introduced in SQL 2012.

My question is, how can I get the database project to not compile or create an error if someone uses a function which is not supported on the specified target platform?

At present, we do not find out about this problem until we deploy to a site which uses SQL 2008.

Laurence Frost
  • 2,759
  • 3
  • 28
  • 45
  • What version of SQL Server Data Tools have you got installed? I believe that the oldest you can get is for Visual Studio 2012, therefore, for SSDT this is valid. – otri Nov 06 '19 at 15:26
  • It's the version which is installed with Visual Studio 2019. – Laurence Frost Nov 06 '19 at 15:45

0 Answers0