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 |
Sitka
Aged Yak Warrior
571 Posts |
Posted - 2003-08-29 : 14:34:26
|
I don't know if the Subject is correct but I'm sure many have seen what I'm talking about in Forums such as these. A user searches for something in the message body and the SQL returns a large varchar() or text() datatype from a LIKE query. How do you highlight the string searched for when displaying the result. Must be a canned function out there somewhereVoted best SQL forum nickname...."Tutorial-D" |
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2003-08-29 : 14:38:51
|
Well on the ASP side, you could use Replace() to handle it. Something like this:Response.write Replace(oRs("MyBigField"), mySearchTerm, "<B>" & mySearchTerm & "</B>") What you'll need to do is get an array of your keywords and loop through that array and replace the keywords with highlighted keywords.Does that make sense?Michael<Yoda>Use the Search page you must. Find the answer you will.</Yoda> |
|
|
Sitka
Aged Yak Warrior
571 Posts |
Posted - 2003-08-29 : 15:37:05
|
Thanks,of course it makes sense.Canned function like duh REPLACE()Hooo Hoo Hooo Haaa.I'm laughing at myself hereFreaking, some days....man. I even took a drive to clear my head. Right in the middle of after lunches session, couldn't focus on nothing. Think because the IT guys get pizza on Friday my blood sugar goes way up then comes crashing down. Getting productive now though, everything seems kind of effortless and lightheaded, just the way I like it.Again thanksVoted best SQL forum nickname...."Tutorial-D" |
|
|
|
|
|