'Need to modify the data type of a view column

Alter view [dbo].[M12_qry_DQBase_Figures] 
Alter column [Good_Objects] Integer;

Convert (Integer, [dbo].[M12_qry_DQBase_Figures].[Good_Objects] )

the above two queries are not working to change data type from Varchar to Integer in SQL server help me if possible

Column details mentioned below

Good_Objects: [ARIS_Output].[Number_Objects]-If(IsNull([M11_qry_DQ_Objects_with_errors].[Number_Objects]),0,[M11_qry_DQ_Objects_with_errors].[Number_Objects])


Solution 1:[1]

if you need the integer type only in the view you can acess de view script and cast the column from varchar to int, if you need to set and get the value into the DB you must update the view and the table.

note that view works like a "mask" of a select statement or complex procedure/validation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marcio Rocha