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 :thumb:
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"
Re: split string to individual word
Quote:
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?
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 :thumb: