sivajii (9/2/2012)
but here is used the cross split function in my original proc which i mentionedi want to check all column it was itwas not present data means that table value will be also stored
CROSS APPLY dbo.DelimitedSplit8k(@VALUES,'')ds
WHERE
( s.BusinessName LIKE '%'+ REPLACE(RTRIM(LTRIM(ds.Item)), ' ', '%' ) + '%' Or ds.Item IS NULL)
and
( b.ContactPerson1 LIKE '%'+ REPLACE(RTRIM(LTRIM(ds.Item)), ' ', '%' ) + '%' Or ds.Item IS NULL)
and
(b.ContactPerson2 LIKE '%'+ REPLACE(RTRIM(LTRIM(ds.Item)), ' ', '%' ) + '%' Or ds.Item IS NULL)
and
( b.AddressLine1 LIKE '%'+ REPLACE(RTRIM(LTRIM(ds.Item)), ' ', '%' ) + '%' Or ds.Item IS NULL)
Since the stored procedure you wrote doesn't actually work against the test data tables you provided and we have no idea what the @Values variable contains, I suggest that you need to provide a bit more information because there's not really enough info to help you with your problem, yet. It also appears that you're trying to use nothing as a delimiter for the DelimitedSplit8K function and that's just not going to work. You MUST use some form of delimiter for the second operand of the function and the elements in @Values must be separated by that delimiter.
To wit, ever example you've given for @Values, so far, has been NULL.
Also, please stop PMing me about this problem. I'm sorry but I just don't have the time to work as your personal programmer, especially on a holiday weekend. Heh... where do you think everyone else in the U.S. is today? 😉
--Jeff Moden
Change is inevitable... Change for the better is not.