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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 query

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-08-06 : 15:54:30
i need a query or a function to search for special characters like !@#$%^&*() in the table column value..

Thanks for your help in advance

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-06 : 16:01:17
where col like '%[!@#$%^&*()]%'

Be One with the Optimizer
TG
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-08-06 : 16:39:01
Thanks !

How can i check for space..in field value.
Example: 51 25 23
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-06 : 16:46:27
add whatever special characters you want to include in the character search to the list inside the square brackets []

Be One with the Optimizer
TG
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-08-06 : 16:54:22
I put space its not working..
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-08-06 : 17:18:10
How can i implement the []
for checking the empty space between the characters or numbers..
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-06 : 17:30:44
quote:
Originally posted by sqlfresher2k7

I put space its not working..



Post your code and we'll correct it.

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-08-07 : 01:47:05
quote:
Originally posted by sqlfresher2k7

I put space its not working..



How do you know it is not working?

select col from
(
select 'uihad987123' as col union all
select 'jkhasdh#3iuh2e' union all
select 'lkajsdjkh kjhwerk'
) as t
where col like '%[!@#$%^&*() ]%'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -