Created
June 11, 2009 13:19
-
-
Save tncbbthositg/127894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TRIGGER Benefits.AddressHashcode | |
ON Benefits.Addresses | |
INSTEAD OF INSERT | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
INSERT INTO addresses | |
SELECT City, State, Zip, Street1, Street2, County, | |
ISNULL( | |
Hashcode, | |
HASHBYTES('SHA1', '|' + ISNULL(City, '<NULL>') + '|' + | |
'|' + ISNULL(State, '<NULL>') + '|' + | |
'|' + ISNULL(Zip, '<NULL>') + '|' + | |
'|' + ISNULL(Street1, '<NULL>') + '|' + | |
'|' + ISNULL(Street2, '<NULL>') + '|' + | |
'|' + ISNULL(County, '<NULL>') + '|') | |
) | |
FROM inserted; | |
END | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment