I want to have the following on SQL Azure:
IF EXISTS(SELECT * FROM [sys].[databases] WHERE [name] = db_name() AND [compatibility_level] = 110)
BEGIN
ALTER PROCEDURE [dbo].[Test] AS
BEGIN
-- Omitted body containing lots of strings
END
END
or a work-around that does something similar. What follows is what I'm trying to avoid:
IF EXISTS(SELECT * FROM [sys].[databases] WHERE [name] = db_name() AND [compatibility_level] = 110)
BEGIN
EXEC [sys].[sp_executesql] N'ALTER PROCEDURE [dbo].[Test] AS
BEGIN
-- Omitted body containing lots of strings
END'
END
The reason I want to avoid the above, is because the stored procedure contains a lot of strings that need escaping.