Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to verify that a user has entered only alphanumeric characters 1

Status
Not open for further replies.

slaver

Programmer
May 23, 2002
5
GB
HI,

IS IT POSSIBLE TO verify that a user has entered only alphanumeric characters IN SQL SERVER.

I KNOW THE VARIOUS METHODS ON THE CLIENT SIDE, BUT I NEED TO DO THIS IN SQL SERVER THROUGH A STORED PROCEDURE OR TRIGGER OR RULE OR CONSTRAINT.

THE BEST I CAN COME UP WITH SO FAR IS:

CREATE RULE vchar_input_rule
AS @vchar_input not like '%?%'
GO
EXEC sp_bindrule vchar_input_rule, 'tbl_gData_Person.vchar_Surname'

IS THERE ANOTHER WAY ?

THANKS
 
I think the following rule will work:

CREATE RULE vchar_input_rule
AS @vchar_input not like '%[^0-9,^A-Z,^a-z]%'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top