December 7, 2009 at 12:57 pm
have a field called Password.
The following checks need to be applied on it.
1)Must be 12 char long
2)pass must contain atleast 3 of the following
a)lowercase
b)uppercase
c)numbers(0-9)
d)special characters !,@,#,$,%,^,&,*, (,)
how would i apply these constraints?
Thanks
December 7, 2009 at 1:15 pm
I am not an expert on this, but I would think that when you create the Password field that it would be of a datatype like varchar with a limit set to the amount of characters that you will allow the password to be. For the other requirements, it can probably be done with a DML trigger that checks for those conditions.
http://msdn.microsoft.com/en-us/library/ms191524.aspx
http://msdn.microsoft.com/en-us/library/ms189799.aspx
Joie Andrew
"Since 1982"
December 7, 2009 at 1:15 pm
I wouldn't apply these constraints in the table themselves, the main reason is that the data would need to be in clear-text and that is wholly unacceptable for a password field. This field should contain encrypted data and the checks you are describing should be applied during the stored procedure that performs the encryption.
CEWII
December 7, 2009 at 2:07 pm
thanks
December 7, 2009 at 2:09 pm
Discuss with the application developers to make some checks on their side, at least a few if not all.
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply