DECLARE @Tablename NVARCHAR(MAX) ,
    @ColumnName NVARCHAR(MAX) ,
    @CommandText NVARCHAR(MAX) ,
    @ColumnType NVARCHAR(MAX) ,
    @row INT
SET @row = 0    
UPDATE History_Price
SET USER_ID = '100'
WHERE ISNUMERIC(USER_ID) <> 1 OR (USER_ID IS NULL AND USER_ID = '')
DECLARE UserIdCursor CURSOR
FOR
    SELECT  SO.name AS 'TableName' ,
            SC.name AS 'ColumnName' ,
            SM.texttype
    FROM    dbo.sysobjects SO
            INNER JOIN dbo.syscolumns SC ON SO.id = SC.id
            LEFT JOIN dbo.syscomments SM ON SC.cdefault = SM.id
    WHERE   SO.xtype = 'U'
            AND ( SM.text LIKE '%Suser_Id%'
                  OR SM.text LIKE '%Duser_Id%'
                )
    ORDER BY SO.[name] ,
            SC.colid 
OPEN UserIdCursor
FETCH NEXT FROM UserIdCursor   
INTO @Tablename, @ColumnName, @ColumnType
WHILE @@FETCH_STATUS = 0
    BEGIN  
        SET @row = @row + 1
        SET @CommandText = 'EXEC sp_unbindefault '''+ @Tablename + '.' + @ColumnName +''' ; ALTER TABLE ' + @Tablename + ' ALTER COLUMN ' + @ColumnName + ' SMALLINT NULL; '
        EXEC sp_executesql @CommandText         
        FETCH NEXT FROM UserIdCursor   
INTO @Tablename, @ColumnName, @ColumnType
    END   
CLOSE UserIdCursor;  
DEALLOCATE UserIdCursor  