Add object existence checks option is preventing ALTER

dschaeffdschaeff Posts: 12
edited August 1, 2017 9:21AM in SQL Compare 11
When "Add object existence checks" is checked the generated script fails to perform alter's. Note the generated script below only executes the alter if the object does not exist.
PRINT N'Altering [dbo].[AccuCastCustom_DistinctValueCountsPDE]'
IF OBJECT_ID(N'[dbo].[AccuCastCustom_DistinctValueCountsPDE]', 'P') IS NULL
EXEC sp_executesql N' -- =============================================
-- Author:      Mike
-- Create date: 7/10/14
-- Description: This stored procedure returns a count of various distinct values.
-- [mmason] 9/8/14 Added @StartDate & @EndDate
-- =============================================
ALTER PROCEDURE [dbo].[AccuCastCustom_DistinctValueCountsPDE]


Sign In or Register to comment.