IF EXISTS ( SELECT  *
            FROM    dbo.sysobjects
            WHERE   id = OBJECT_ID(N'[dbo].[Sp_RemoveDuplicateRowFactor]')
                    AND OBJECTPROPERTY(id, N'IsProcedure') = 1 )
    DROP PROCEDURE [dbo].[Sp_RemoveDuplicateRowFactor]

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[vw_EShopGoods]') and xtype='V')
Drop view [dbo].[vw_EShopGoods]