Alphanumeric and Special Character Validation
=========================================
/*
Function name: fn_ValidateString
Description : This function is used to validate whether the given string contains Alphanumeric character and some special character’s ‘@’ ,’(‘, ‘ )’, ‘_’, ‘-‘
Parameters: 1) @InputString varchar(25)
Accepts the string, which we need to validate
2) @Type int
= 0 validate the string for only alphanumeric characters
i.e Allows characters between [A-Z] ,[a-z] and [0-9]
= 1 validate the string for alphanumeric and special characters - ‘@’ ,’(‘, ‘ )’, ‘_’, ‘-‘
Return type: int
If the passed string is valid, it returns 1
Else 0
Usage:
1) Select dbo.fn_ValidateString('asd(a3)3_3AAAXXX-3',0)
Return 0 – Failure
Because it contains special characters (, )
2) Select dbo.fn_ValidateString('asda333AAAXXX3',0)
Returns 1 – Success only alpha numerics
3) Select dbo.fn_ValidateString('asd(a3)3_3AAAXXX-3',1)
Return 1 – Success
4) Select dbo.fn_ValidateString('asd(a3)3_3AAAXXX-3%''^&',1)
Return 0 – Failure
*/
A Normalization Primer
For most DBAs, normalization is an understood concept, a bread and butter bit of knowledge. However, it is not at all unusual to review a database design by a development group for an OLTP (OnLine Transaction Processing) environment and find that the schema chosen is anything but properly normalized. This article by Brian Kelley will give you the core knowledge to data model.
2003-01-13
18,597 reads