Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dumbdumb
Starting Member
5 Posts |
Posted - 2004-03-17 : 20:24:42
|
| Hi allHow do I ckeck whether there is upper case, lower case, symbol and number for an input parameter belonging to a store procedure.Sorry for posting similar question again but I need urgent help! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-03-17 : 20:27:37
|
| I don't understand what you mean. Do you mean inside the variable (meaning data) or the variable name itself? Please provide an example.Tara |
 |
|
|
dumbdumb
Starting Member
5 Posts |
Posted - 2004-03-17 : 20:49:02
|
| Take the example below, How do I check whether the @strTest value contain at least one upper case, one lower case, one numeric, and lastly one non-alphanumeric character?CREATE PROCEDURE AM_ValidatePwdAs DECLARE @strTest as varchar(20) SET @strTest = 'test test the water%1E'Go |
 |
|
|
byrmol
Shed Building SQL Farmer
1591 Posts |
Posted - 2004-03-17 : 20:59:56
|
dumbdumb,I take it that example equates to a failure....Have you read the pattern matching section in BOL? If not, do so....You will simply expand the expression I gave you before.....DECLARE @T VARCHAR(1000)SET @T = 'assfasD2fs^'--ORIF @T LIKE '%[abcdefgfhijklmnopqrstuvwxyz]%' COLLATE latin1_general_cs_as AND @T LIKE '%[ABCDEFGHIJKLMNOPQRSTUVWXYZ]%' COLLATE latin1_general_cs_as AND @T LIKE '%[0-9]%' AND @T LIKE '%[^0-9a-Z]%'PRINT 'OK'ELSEPRINT 'No' DavidM"An Ugg Boot is a generic Australian term that has been in use for nearly 100 hundred years. Now some coporate wanker has trademarked it.. " |
 |
|
|
dumbdumb
Starting Member
5 Posts |
Posted - 2004-03-17 : 22:06:34
|
| Hi byrmol, Thanks, Solve my problem! |
 |
|
|
|
|
|