if exists(select 1 from sys.views V inner join sys.[schemas] S on  v.schema_id = s.schema_id where s.name='IES' and v.name = 'V_SCHET_USL_LPU_1' and v.type = 'V')
    DROP VIEW [IES].[V_SCHET_USL_LPU_1]
GO

CREATE VIEW [IES].[V_SCHET_USL_LPU_1]
AS
    select su.SchetUslID, fs.F033SpmoID F033Spmo
    from IES.T_SCHET_USL su
        join IES.T_F033_SPMO fs on fs.IDSPMO = su.LPU_1
    where fs.Actual = 1
GO
