17.07.2015 Views

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7 – One-Way EncryptionWHEREBorrower_Identification_ID =@Borrower_Identification_ID;END TRYBEGIN CATCH-- Returns the error informationSELECTERROR_NUMBER() AS ErrorNumber,ERROR_SEVERITY() AS ErrorSeverity,ERROR_STATE() AS ErrorState,ERROR_MESSAGE() AS ErrorMessage;END CATCHGOListing 7-11: Creating the Update_Borrower_Identification storedprocedure.The stored procedure that will be used to perform the INSERT methods will becalled Insert_Borrower_Identification. Passed into this storedprocedure as parameters are:• The plain text value of the borrower's identification value.• The foreign key value that defines the identification type.• The foreign key value for the borrower to which the identificationrecord is associated.The script to create this stored procedure is shown in Listing 7-12.USE HomeLending;GOCREATE PROCEDURE dbo.Insert_Borrower_Identification@Borrower_ID bigint,@Identification_Type_ID int,@Identification_Value varchar(250)ASBEGIN TRY-- Get SaltDECLARE @Salt varchar(7)SET @Salt = dbo.GetHashSalt('L01');-- Performs the update of the recordINSERT INTO dbo.Borrower_Identification(Borrower_ID,Identification_Type_ID,Identification_Value_H,165

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!