Posted on

POST Data Migration

Noticed that Transfer Table field Name Change Requires

Transfer Table:

Rename : LocCode –> Loc_Code

Adding Sub_Fund varchar(50)

Modifying 

ALTER PROCEDURE [dbo].[addTransfer]
     — Add the parameters for the stored procedure here
     @ttp_code float,
     @age_code float,
     @minobj nvarchar(255),
     @tc nvarchar(255),
     @td nvarchar(255),
     @reference nvarchar(255),
     @processed datetime,
     @trandate datetime,
     @tra float,
     @average float,
     @comments nvarchar(255),
     @lupd_user nvarchar(255),
     @con nvarchar(255),
     @supdist nvarchar(255),
     @payreqnum nvarchar(255),
     @payee nvarchar(255),
     @loccode nvarchar(255),
     @subfund varchar(50)

AS
BEGIN
     — SET NOCOUNT ON added to prevent extra result sets from
     — interfering with SELECT statements.

     — Insert statements for procedure here
     INSERT INTO [TRANSFERS]
     ([TRA_CODE],
     [TTP_CODE],
     [AGE_CODE],
     [MINOBJ],
     [TC],
     [TD],
     [REFERENCE],
     [PROCESSED],
     [TRANDATE],
     [TRA],
     [AVERAGE],
     [COMMENTS],
     [LUPD_USER],
     [LUPD_DATE],
     [LUPD_TIME]     
     ,[CON]
       ,[SUPDIST]
       ,[PayReqNum]
       ,[Payee]
       ,[Loc_Code]
       ,[Sub_FUnd]
       )

    SELECT MAX([TRA_CODE])+1, @ttp_code, @age_code, @minobj, @tc, @td, @reference,@processed,@trandate,@tra,@average,
     @comments, @lupd_user, GETDATE(), Convert(varchar, GETDATE(),108),     @con,@supdist,@payreqnum,@payee,@loccode,@subfund
     FROM [TRANSFERS]

END

 

Also Following Stored Procedure needs to be changed:

USE [FOXPRODEV]
GO
/****** Object:  StoredProcedure [dbo].[editTransfers]    Script Date: 10/20/2016 3:00:09 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Author:        sovath
— Create date:
— Description:    editransfers
— =============================================
ALTER PROCEDURE [dbo].[editTransfers]
     — Add the parameters for the stored procedure here
     @tra_code float,
     @ttp_code float,
     @age_code float,
     @minobj nvarchar(255),
     @tc nvarchar(255),
     @td nvarchar(255),
     @reference nvarchar(255),
     @processed datetime,
     @trandate datetime,
     @tra float,
     @average float,
     @comments nvarchar(255),
     @lupd_user nvarchar(255),
     @supdist nvarchar(255),
     @payreqnum nvarchar(255),
     @payee nvarchar(255),
     @loccode nvarchar(255),
     @subfund varchar(50)

AS
BEGIN
     — SET NOCOUNT ON added to prevent extra result sets from
     — interfering with SELECT statements.

    UPDATE [TRANSFERS] set
     [TTP_CODE] = @ttp_code,
     [AGE_CODE] = @age_code,
     [MINOBJ] = @minobj,
     [TC] = @tc,
     [TD] = @td,
     [REFERENCE] = @reference,
     [PROCESSED] = @processed,
     [TRANDATE] = @trandate,
     [TRA] = @tra,
     [AVERAGE] = @average,
         [COMMENTS] = @comments,
     [LUPD_USER] = @lupd_user,
     [SUPDIST] = @supdist,
     [PayReqNum]= @payreqnum,
     [Payee]= @payee,
     [Loc_Code]=@loccode,
     [sub_fund] = @subfund

    WHERE [TRA_CODE] = @tra_code

 

END