Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
query for like search alphanumerics and allow spaces
Posted

1 solution

SQL
select *from AdminLogin where password like '[A-Za-z@_$]%'

you can add character list in char list.
 
Share this answer
 
Comments
Member 8288629 30-Nov-11 7:27am    
but i take directly column below my code only individual name, code search
but i want alphanumeric and allow spaces

alter procedure getBusinessEntityLocationsByLocationName
(
@location_name varchar(100)

)
as
begin
if @location_name is null

select location_name + '(' + cast(location_id as varchar) + ')' as location from BusinessEntityLocations

else
select location_name + '(' + cast(location_id as varchar) + ')' as location
from BusinessEntityLocations where location_name Like '%' + @location_name+ '%' or location_id Like '%' + @location_name + '%'

end
Member 8288629 30-Nov-11 7:53am    
but i take directly column, below my code only individual name, code search
but i want alphanumeric and allow spaces

alter procedure getBusinessEntityLocationsByLocationName
(
@location_name varchar(100)

)
as
begin
if @location_name is null

select location_name + '(' + cast(location_id as varchar) + ')' as location from BusinessEntityLocations

else
select location_name + '(' + cast(location_id as varchar) + ')' as location
from BusinessEntityLocations where location_name Like '%' + @location_name+ '%' or location_id Like '%' + @location_name + '%'

end
uspatel 30-Nov-11 23:48pm    
try
select *from AdminLogin where password like '[location_name]%'

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900