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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to check char length?

Author  Topic 

codrgiii
Starting Member

29 Posts

Posted - 2009-07-26 : 04:05:56
in sql how is it possible to check a length of input and if it's the input is shorter than 4 then cancel it by returning an error msg?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-26 : 04:26:04
use len(col) or datalength(col)


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

codrgiii
Starting Member

29 Posts

Posted - 2009-07-26 : 05:28:30
thanks :)
and how would i make it accept only the characters A-Za-z0-9?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-07-26 : 18:03:24
have a look at LIKE in Books OnLine
Go to Top of Page
   

- Advertisement -