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.
| Author |
Topic |
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-01-16 : 09:22:19
|
| Hi AllI have a database I want to check whether any special characters are entered or not E.g. Post-------DirectorAsst*DirectorMa^nagerI want to see all the entires where special characters like !@#$%^&*()_+ are entered Plz helpThanks |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-16 : 09:28:09
|
Start with thisSelect * from (select 'test' as data union all select '^sdf' union all select 'testing&' union all select 'select *') t where data like '%[!@#$%^&*()_+]%' MadhivananFailing to plan is Planning to fail |
 |
|
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-01-16 : 09:31:37
|
| thanks madhivanan , can you get online on the yahoo plz |
 |
|
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-01-16 : 09:41:30
|
| am not able to get it, can you plz explain it in more details |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-16 : 09:44:36
|
| That query will take data which has atleast one of !@#$%^&*()_+MadhivananFailing to plan is Planning to fail |
 |
|
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-01-16 : 10:12:50
|
| ok , now if i had only one column say "Post" I would say :- Select * from table where Post like '%[!@#$%^&*()_+]%'& what if i had 10 columns, would I have to write Select * from table where Col1 like '%[!@#$%^&*()_+]%'goSelect * from table where Col2 like '%[!@#$%^&*()_+]%'....etcPlz help Thanks |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-16 : 23:59:58
|
| Select * from table where Col1 like '%[!@#$%^&*()_+]%' or Col2 like '%[!@#$%^&*()_+]%' or ,....ColN like '%[!@#$%^&*()_+]%'MadhivananFailing to plan is Planning to fail |
 |
|
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-01-19 : 11:03:00
|
| hey I typed the following :- Select emailid from Table where emailid like '%[~`!#$%^&*()-+=?|\/,;:]%'It shows me xxx@xxx.COM xxxx@xxxxxxxx.COM Why ??? I have not seacrhed for :- @ . .... then why ????? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-20 : 00:44:30
|
No it wont return themSelect * from ( select 'test' as data union all select '^sdf' union all select 'testing&' union all select 'select *' union all select 'xxx@xxx.COM' union all select 'xxxx@xxxxxxxx.COM' ) t where data like '%[!#$%^&*()_+]%' MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|