views:

163

answers:

3

I have a table called Field in my SQL Server database. The table has a field called "Units".

I have a batch script which inserts a lot of things into here using OSQL and one of the things entered is the pound sign (£). When OSQL runs the queries, it converts the £ sign to -ú instead.

What I need to have is a separate batch file which updates all this at the end

e.g.

update field set units = '£' where units = '-ú'

This sql above works fine if I run in a query but through OSQL it doesn't work.

I have found that editing the file in DOS mode in TextPad allows me to put in the DOS symbol for £ and that bit works ok, but I don't know how to replace the -ú part so I can do the replacement.

Any ideas?

A: 

I believe that what you need to do is pass the ASCII value of the character, using chr(XX), where XX is the ASCII value for '-ú'

hminaya
+1  A: 

Got it

update field set units = 'œ' WHERE units = '-£'

I took the character from my database, pasted it into the file which was in DOS mode then saved. I then opened this file up in TextPad and it came up as -£

Worked fine

Thanks

Graeme
A: 

have OSQL run a stored procedure:

CREATE PROCEDURE FixIt
AS

update field set units = '£' where units = '-ú'

GO
KM