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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 stored procedure to act as a function call..

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-20 : 17:37:32
Sam writes "Hi there,
I have an interesting problem: I've developed a web app. that stores information in a database for later retrieval via the web. However, the data stored in a database is also copied into a legacy host system that can't handle any characters that is not in the a letter or a number (i.e. it can't handle any punctuation marks like apostrophe's or periods or anything). We are using another platform to build the data in the host system and I want to deliver the data to this intermediate platform via a stored procedure, with all the punctuation marks and extra characters removed.

Also, we need to store the punctuation marks as people's names (like O'Connor) are technically incorrect without them.

I would normally use something like this:

select replace(firstname,"'",""), replace(lastname,"'","") FROM
...

to remove the apostrophe. Obviously, this is kind of unwieldy for removing all the other characters (!@#$^... etc).

I'd like to have "Function" that returns the input string with characters removed, but I don't think you can do that on SQL server."
   

- Advertisement -