I'm writing a SQL script that needs to be able to run on multiple SQL engines, namely SQL Server and Azure SQL. An IF statement checks the database version to execute the correct code. But the code won't compile if used on the wrong engine.
This works fine in Azure SQL, but SQL Server rejects it.
IF (@@VERSION LIKE 'Microsoft SQL Azure %')
BEGIN
ADD SENSITIVITY CLASSIFICATION TO [dbo].[User].[UserName] WITH (LABEL = 'Confidential', INFORMATION_TYPE = 'Credentials')
...
END
GO
What are my options for ensuring this is accepted by both engines?