This should be simple but I can figure it out for the life of me. Basically I have a stored procedure that updates a database. In the database I have forename and surname columns and the stored procedure is doing the business logic. What I want to be able to do is if someone tries to enter multiple names it identifies that based on a series of replaces statements and returns NULL if it finds any, for example like in the code below it is looking for a "/" (as if it was looking for someone doing something like John / Jill) just like in the sample code below:
Declare @Forename Varchar(50)
Set @Forename = 'John'
Select Replace(@Forename,'/',NULL)
However instead of retuning 'John' it returns NULL even though there is no / present. I've had a google about but I can't find anything. Of course in my real code there are many nested replace statements but this is just to show you what the issue is i am up against. Any help would be great.
Thanks in advance