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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2009-07-02 : 14:47:05
|
| How to delete any record with "*"?For example, the following records should be deleted:abc*fg*abcabc* |
|
|
TheSQLGuru
SQL Server MVP
10 Posts |
Posted - 2009-07-02 : 15:25:11
|
| select * from mytable where myfield like '%*%'change that to a deleteKevin G BolesTheSQLGuruIndicium Resources, Inc. |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-07-03 : 01:03:57
|
| try this tooselect * from mytable where patindex('%*%',myfield)>0delete from mytable where patindex('%*%',myfield)>0 |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-07-03 : 01:22:31
|
| This too will help u..delete from mytable where charindex('*',myfield)>0Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceled |
 |
|
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-07-03 : 03:53:31
|
| HiMore info CHARINDEX returns NULL when the database compatibility level is 70 or later. If the database compatibility level is 65 or earlier, CHARINDEX returns NULL only when both expression1 and expression2 are NULL. If expression1 is not found within expression2, CHARINDEX returns 0. |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-07-03 : 05:02:58
|
quote: Originally posted by rajdaksha HiMore info CHARINDEX returns NULL when the database compatibility level is 70 or later. If the database compatibility level is 65 or earlier, CHARINDEX returns NULL only when both expression1 and expression2 are NULL. If expression1 is not found within expression2, CHARINDEX returns 0.
Good and valuable information!Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-07-03 : 05:12:12
|
| thanks |
 |
|
|
|
|
|