CREATE PROCEDURE dbo.TempAlterProductPriceField @FieldName VARCHAR(255) AS 
BEGIN
  SET NOCOUNT ON

  DECLARE @ConstraintName VARCHAR(255)
  DECLARE @sql NVARCHAR(2000)

  DECLARE #TempCur CURSOR SCROLL STATIC FOR
  SELECT 
    default_constraints.name
  FROM sys.all_columns
  INNER JOIN sys.tables ON all_columns.object_id = tables.object_id
  INNER JOIN sys.schemas ON tables.schema_id = schemas.schema_id
  INNER JOIN sys.default_constraints ON all_columns.default_object_id = default_constraints.object_id
  WHERE schemas.name = 'dbo'
    AND tables.name = 'ProductPrice'
    AND all_columns.name = @FieldName
  OPEN #TempCur
  FETCH NEXT FROM #TempCur INTO @ConstraintName
  WHILE @@FETCH_STATUS = 0
  BEGIN
    SET @sql = N'ALTER TABLE ProductPrice DROP CONSTRAINT ' + @ConstraintName
    EXEC sp_executesql @sql
    FETCH NEXT FROM #TempCur INTO @ConstraintName
  END

  SET @sql = N'ALTER TABLE ProductPrice ALTER COLUMN ' + @FieldName + ' MONEY NULL'
  EXEC sp_executesql @sql

  FETCH FIRST FROM #TempCur INTO @ConstraintName
  WHILE @@FETCH_STATUS = 0
  BEGIN
    SET @sql = N'ALTER TABLE ProductPrice ADD CONSTRAINT ' + @ConstraintName + ' DEFAULT (0) FOR [' + @FieldName + ']'
    EXEC sp_executesql @sql
    FETCH NEXT FROM #TempCur INTO @ConstraintName
  END
  CLOSE #TempCur
  DEALLOCATE #TempCur
END
GO

DECLARE @datatype VARCHAR(100)

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice1'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice1'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice2'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice2'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice3'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice3'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice4'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice4'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice5'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice5'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice6'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice6'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice7'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice7'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice8'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice8'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'AdultPrice9'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'AdultPrice9'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price1'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price1'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price2'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price2'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price3'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price3'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price4'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price4'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price5'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price5'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price6'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price6'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price7'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price7'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price8'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price8'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children1Price9'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children1Price9'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price1'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price1'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price2'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price2'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price3'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price3'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price4'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price4'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price5'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price5'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price6'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price6'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price7'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price7'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price8'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price8'

SELECT @datatype = DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductPrice' AND COLUMN_NAME = 'Children2Price9'
IF @datatype = 'smallmoney'
  EXEC TempAlterProductPriceField 'Children2Price9'

DROP PROCEDURE dbo.TempAlterProductPriceField
GO
