if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetShopCode]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[GetShopCode] 

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Sodor_Factor]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Sodor_Factor]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Sodor_Vajeh]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Sodor_Vajeh]



if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Sodor_Sanad]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Sodor_Sanad]


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Create_Sanad_Auto]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Create_Sanad_Auto]



if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Create_Sanad_Radif]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Create_Sanad_Radif]