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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 string check in sp

Author  Topic 

craigmacca
Posting Yak Master

142 Posts

Posted - 2009-03-16 : 08:52:03
Hi i need to check a string i am passing in to a sp

this is what i need

1. @content is a string

2. first check @content does not contain any words from my vulgarity table

3. if any matchs replace word with *****

4. then i will do a insert into my table

**valgarity table**
id
word

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-16 : 09:00:27
replace what with *****??
Go to Top of Page

craigmacca
Posting Yak Master

142 Posts

Posted - 2009-03-16 : 10:02:53
replace any words in the string that matches words found in the vulgarity table
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-16 : 10:22:41
[code]
SELECT @Content=REPLACE(@Content,word,'*****')
FROM vulgarity

INSERT INTO YourTable (content,..)
VALUES (@content,...)
[/code]
Go to Top of Page
   

- Advertisement -