Hey guys,
I am building a suggestive tagging system (sounds seedy), I pass in a string to the db and if there is a match it sends back that tag. I want to stop duplicate tags, so if one tag is WEB, I only want it to be returned once. So if I had WEB as a tag and then add WEEKLY, typing "WE" doesn't bring up WEB for a second time as a suggestion.
But, seem to be not working. I send the current tags and use NOT IN() to remove any duplicates. Below is the SP code:
SELECT TOP 1 t.vTagName As vTagName
FROM Tags t
WHERE t.vTagName LIKE @vTagName+'%'
AND t.nTagPortalId = @nPortalId
AND t.vTagName NOT IN(@vCurrentTags)
ORDER BY vTagName ASC
And this is what get's passed in:
EXEC GetTagSuggest 'We','Web,Print,Design,Advertising,Revenue'
The response to this query is vTagName = Web. Obviously, this is not a correct result as it should be vTagName LIKE "We" NOT IN "Web, etc..."..
Thanks in advance!