Вы находитесь на странице: 1из 2

ALter table TempOrderList alter column Actual_Sold dec(18,2);

ALter table TempOrderList alter column Spot_Amount dec(18,2);

CREATE PROCEDURE [dbo].[p_UpdateExpirationSelBus1]


@IdBusiness VARCHAR(30),
@IsExpired BIT,
@IdBusinessStatus INT,
@ExpirationDays TINYINT
AS
BEGIN
UPDATE SelectedBusinesses SET IsExpired = @IsExpired, IdBusinessStatus =
@IdBusinessStatus, ExpirationDays = @ExpirationDays WHERE IdBusiness = @IdBusiness;
DELETE FROM BusinessNote WHERE IdBusiness = @IdBusiness;
DELETE FROM CallHistory WHERE IdBusiness = @IdBusiness;
DELETE FROM Callback WHERE IdBusiness = @IdBusiness;
END

CREATE PROCEDURE [dbo].[p_UpdateExpirationSelBus2]


@IdBusiness VARCHAR(30),
@IsExpired BIT,
@ExpirationDays TINYINT
AS
BEGIN
UPDATE SelectedBusinesses SET IsExpired = @IsExpired, ExpirationDays =
@ExpirationDays WHERE IdBusiness = @IdBusiness;
END

USE ROD_OLD;
ALTER TABLE RaiCustomerMaster ADD Longitude decimal(9, 6) NULL
ALTER TABLE RaiCustomerMaster ADD Latitude decimal(9, 6) NULL

<Column Name="Longitude" Type="System.Decimal" DbType="Decimal(18,6)"


CanBeNull="true" />
<Column Name="Latitude" Type="System.Decimal" DbType="Decimal(18,6)"
CanBeNull="true" />
<Column Name="PhoneNumber2" Type="System.String" DbType="VarChar(15)"
CanBeNull="true" />

ALTER TABLE TempOrderList ADD IsPaidInFull bit NOT NULL default 0


ALTER TABLE TempOrderList ADD IdBusinessStatus INT NOT NULL DEFAULT(-1)

ALTER TABLE TempOrderList ADD CONSTRAINT [FK_TempOrderList_ToBusinessState] FOREIGN


KEY ([IdBusinessStatus]) REFERENCES [dbo].[BusinessStatus] ([Id])

UPDATE TempOrderList SET IdBusinessStatus = CASE WHEN (SELECT


COUNT(IdBusinessStatus) FROM SelectedBusinesses WHERE IdBusiness =
TempOrderList.IdBusiness) > 0
THEN (SELECT IdBusinessStatus FROM SelectedBusinesses WHERE IdBusiness =
TempOrderList.IdBusiness) ELSE 7 END

UPDATE TempOrderList SET IdBusinessStatus = 7 WHERE IdBusinessStatus = -1

ALTER TABLE RaiCustomerMaster ADD IdBusinessStatus INT NOT NULL DEFAULT(-1)

<Column Name="IdBusinessStatus" Type="System.Int32" DbType="Int"


CanBeNull="false" />