|
-
May 15th, 2006, 05:33 AM
#1
Thread Starter
Fanatic Member
split string to individual word
sql enterprise manager (2000)
i pass a variable to a stored procedure.
the variable is
@MsgTxt varchar(160),
i have a table in the db which holds keywords in it.
what i want to do is a check on each individual word contained within
@MsgTxt
for a match on my table table_keyword
is this possible
---
thankyou in advance for any replys
it works 60% of the time, all the time.
-
May 15th, 2006, 08:53 PM
#2
Frenzied Member
Re: split string to individual word
you can use the split function in vb6 to achieve what you want.
like this
VB Code:
Dim StrArray() as String
Dim YourString As String
YourString = "This is your String"
StrArray = Split(YourString)
the result would be
StrArray(0) = "This"
StrArray(1) = "is"
StrArray(2) = "your"
StrArray(3) = "String"
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
May 15th, 2006, 08:56 PM
#3
Re: split string to individual word
 Originally Posted by d3gerald
you can use the split function in vb6 to achieve what you want.
like this
VB Code:
Dim StrArray() as String
Dim YourString As String
YourString = "This is your String"
StrArray = Split(YourString)
the result would be
StrArray(0) = "This"
StrArray(1) = "is"
StrArray(2) = "your"
StrArray(3) = "String"
I think he needs in T-SQL?
-
May 16th, 2006, 05:06 AM
#4
Thread Starter
Fanatic Member
Re: split string to individual word
cheers guys,
i did want it in sql
but i already had a function in place that split the string in the vb.net side
then i run the stored procedure on each word.
basically i am worried i am making an error on this process being 'heavy work'
i.e. if the string has 15 words, i have to execute that stored procedure 15 times - program side.
but i suppose i would have to check each word individually anyway to acheive this
it works 60% of the time, all the time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|