if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MISTABLEPackSum]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
begin 
	CREATE TABLE [dbo].[MISTABLEPackSum](
		[ProductWareLinkNumber] [int] NOT NULL,
		[PackageSum] [money] NOT NULL,
		[PackageVatOfSum] [money] NOT NULL,
	 CONSTRAINT [PK_MISTABLEPackSum] PRIMARY KEY CLUSTERED 
	(
		[ProductWareLinkNumber] ASC
	)
	) ON [PRIMARY]
end
else
begin
	IF NOT EXISTS
	(
	  SELECT SysColumns.Name 
	  FROM SysObjects(NOLOCK) 
		INNER JOIN SysColumns(NOLOCK) ON SysColumns.Id = SysObjects.ID 
		AND SysColumns.Name = 'PackageSum'
		WHERE SysObjects.Name = 'MISTABLEPackSum'
	)
	begin
		DROP TABLE [dbo].[MISTABLEPackSum]
		CREATE TABLE [dbo].[MISTABLEPackSum](
			[ProductWareLinkNumber] [int] NOT NULL,
			[PackageSum] [money] NOT NULL,
			[PackageVatOfSum] [money] NOT NULL,
		 CONSTRAINT [PK_MISTABLEPackSum] PRIMARY KEY CLUSTERED 
		(
			[ProductWareLinkNumber] ASC
		)
		) ON [PRIMARY]
	end
end