March 17, 2008 at 6:07 pm
i am trying to create a user defined data type in query anylazer
so that when i enter a a SSN # i dont have to add the '-'
here is that syntax i wrote so far but i think i am missing something
--sp_addtype SSN,'varchar(11)','NOT NULL'
--GO
--CREATE RULE ssn_id as @au_id = '[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]'
--GO
--exec sp_bindrule 'ssn_id','SSN'
--GO
can someone please help me.
yes i am a noob 😀
March 17, 2008 at 6:27 pm
Don't store formatting symbols in the database. The only thing they're good for is display... you'd have to strip them out of most file transfers and reporting and GUI "field tools" all have a default "SSN" type to display a 9 digit SSN correctly. Also, when you actually get around to encrypting this very sensitive column, there's no need to encrypt the dashes.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply