Home > Archive > Microsoft SQL Server forum > August 2005 > Stored Proc Question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Stored Proc Question
Driesen P via SQLMonster.com

2005-08-05, 7:23 am

Hi Gurus

I have a sproc that checks a certain field in our software. It is to prevent
users from entering alphabets. The problem I have now is that this sproc is
looking for a number to be in there. I need to only raise the error when
there is an alphabet in this field and NOT if the field is blank. Can someone
tell me what I'm doing wrong? Here is my sproc:

If (select isnumeric(SectionalT
itleUnitNo) from sectionaltitle where
applicationid = @applicationid) = 1
Insert into #errors values (1409, @applicationId, 0, 'Y')
Else
Insert into #errors values (1409, @applicationid, 0, 'N')

--The #errors part is my errors table.

Thanks for any help, guys.


--
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Fo...eneral/200508/1
David Portas

2005-08-05, 7:23 am

IF sectionaltitleunitno
LIKE '%[^0-9 ]%'
...

--
David Portas
SQL Server MVP
--

Driesen P via SQLMonster.com

2005-08-05, 9:24 am

Thanks very much, David


--
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Fo...eneral/200508/1
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com