if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ContractOrder_ClientsInfo]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ContractOrder] DROP CONSTRAINT FK_ContractOrder_ClientsInfo
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_OrderSchedule_ClientsInfo]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[OrderSchedule] DROP CONSTRAINT FK_OrderSchedule_ClientsInfo
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ContractOrder_ConCost]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ContractOrder] DROP CONSTRAINT FK_ContractOrder_ConCost
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ConIncome_ContractOrder]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ConIncome] DROP CONSTRAINT FK_ConIncome_ContractOrder
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ConProduct_ContractOrder]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ConProduct] DROP CONSTRAINT FK_ConProduct_ContractOrder
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ConProduct_ProductsInfo]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ConProduct] DROP CONSTRAINT FK_ConProduct_ProductsInfo
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_OrderSchedule_ProductsInfo]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[OrderSchedule] DROP CONSTRAINT FK_OrderSchedule_ProductsInfo
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ContractOrder_SalersInfo]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ContractOrder] DROP CONSTRAINT FK_ContractOrder_SalersInfo
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_InsertClientInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_InsertClientInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_InsertScheduleInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_InsertScheduleInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_a]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_a]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_getClientId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_getClientId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_getProductId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_getProductId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_getSalerId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_getSalerId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_insertContractInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_insertContractInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_test]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_test]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_updateScheduleInfo]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_updateScheduleInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[view_ContractInfo]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[view_ContractInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[view_ScheduleInfo]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[view_ScheduleInfo]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ClientsInfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ClientsInfo]
GO
if exists (select *�