Click to See Complete Forum and Search --> : replace function


dennis
10-24-2002, 06:01 PM
I am using SQL7 and I need to use the replace function. My goal is to update
a field in a table. I need to turn all lowercase 'cps' to uppercase 'CPS'.
This is what I came up with:
Update agency
set agencyname = replace(agencyname, 'cps', 'CPS')

I get an error when I do this though. Error:[Microsoft][ODBC SQL Server [Microsoft][ODBC
SQL Server Driver][Shared Memory]ConnectionCheckForData (CheckforData()).
[Microsoft][ODBC SQL Server Driver][Shared Memory]General network error.
Check your network documentation.

Connection Broken

Matthew mark
11-12-2002, 02:42 PM
Dennis,

I don't know for sure, but I found this curious. I presume you already fixed
it. However, if not, what if you do this...

Update Agency
Set agencyname='CPS'
where agencyname='cps'

?

Matthew

"dennis" <dtucker01@hotmail.com> wrote:
>
>I am using SQL7 and I need to use the replace function. My goal is to update
>a field in a table. I need to turn all lowercase 'cps' to uppercase 'CPS'.
>This is what I came up with:
>Update agency
>set agencyname = replace(agencyname, 'cps', 'CPS')
>
>I get an error when I do this though. Error:[Microsoft][ODBC SQL Server
[Microsoft][ODBC
>SQL Server Driver][Shared Memory]ConnectionCheckForData (CheckforData()).
>[Microsoft][ODBC SQL Server Driver][Shared Memory]General network error.
>Check your network documentation.
>
>Connection Broken
>