Script to Insert GL_Register Records from Backup Table

Issue:

There may be a need to restore records from a backup of the GL_Register when working on a data issue.

Resolution:

The records can be copied into the original table from the backup if needed. The script below can be used to restore the data to its original.

Using the backup table name from your original select statement, change the table name in the From clause to the correct one.

You can use the Where clause to copy over one or more records or to restore all the records it can be removed.

SET IDENTITY_INSERT GL_Register on

go

INSERT INTO [dbo].[GL_Register]

([Register_id],[Account_Id],[Register_Number],[Credit_Or_Debit]

,[Accounting_Period_Id],[Date],[Register_Type_Id],[Reference],[Type_CVEO]

,[Customer_Id],[Vendor_Id],[Employee_Id],[Other_Name],[Offset_Account_Id],[Splits],[Amount],[Mult_Sign],[Memo],[Status],[Is_Offset],[Offset_Register_Id],[Branch_Id],[Job_Id],[Service_Ticket_Id],[Category_Id],[Job_Expense_Code],[Expense_Type_Id],[Post_WIP_Account_Id],[Primary_Register_Number],[Part_Id],[Currency_Id],[Exchange_Rate],[Amount_Nat],[Date_Time_Stamp],[Created_By] ,[Created_On])

Select 

[Register_id],[Account_Id],[Register_Number],[Credit_Or_Debit]

,[Accounting_Period_Id],[Date],[Register_Type_Id],[Reference],[Type_CVEO]

,[Customer_Id],[Vendor_Id],[Employee_Id],[Other_Name],[Offset_Account_Id],[Splits]

,[Amount],[Mult_Sign],[Memo],[Status],[Is_Offset],[Offset_Register_Id],[Branch_Id]

,[Job_Id],[Service_Ticket_Id],[Category_Id],[Job_Expense_Code],[Expense_Type_Id]

,[Post_WIP_Account_Id],[Primary_Register_Number],[Part_Id],[Currency_Id],[Exchange_Rate],[Amount_Nat],[Date_Time_Stamp],[Created_By] ,[Created_On]

from gl_register_Missing_Records

GO

SET IDENTITY_INSERT GL_Register off

go

 

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.