I have a SQL Server database project which is set to target SQL Server 2008 as its 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.