Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The euri symbol (€) appears like a '?'

Status
Not open for further replies.

ejanakieff

Programmer
Sep 9, 2003
62
ES
I have SQL Server 2000 SP3 and the default Code Page is:

Compatibility_42_409_30003 --> 850

I have a Table with a column of the type varchar(8000).
In this column sometimes it's necessari instroduce the euro symbol (€). Now, when we write this symbol, after the SQl Server show it with a '?'.

I Tried change the column collation to 'Latin1_General_CI_AI' --> 1252, but there is the same problem.

I tried too change the type of the column to nvarchar. It work fine, but then only can write 4000 characters into this column, because an unicode char are 2 bytes.

It's possible mantain the type varchar(8000), and to save and show the euro symbol?

Thanks,
Eva Janakieff
 
Have you tried the NTEXT datatype? If you do check the 'text in row' option with sp_tableoption[/] to save the data in the table if the number of characters in the string is no longer than 8000. If that is the case you should be able to reference the field in a SQL statement as with smaller character datatypes.
 
max length of a row is 8060 bytes so the max you will get is 4030 chars in an ntesxt in row even if it is the only column.

You could deine another sysmbol to be the euro and convert it on input/output.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
When a user introduce an "€" I saves at the Data Base "@euro". So, when the user consutls the record I replace "@euro" by "€".

The problem are the reports.
I use DataReports from Visual Basic. I link a report whith a SP defined in the Data Environment. So I can't do a replace for each report. How can I do that the SP make the replace, and return me the "€" symbol. I Thought with a unicode variable, but I'm not get it.

Can you help me?

Thanks,
Eva Janakieff
 
To go back to the original question what happens if you execute

select char(128)

This is the ascii code for the euro symbol. It may be that you just need to apply the euro windows patch to the clients.

otherwise

replace(fld,'@euro',N'€')


======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
The replace works fine.

I have another question:

The users can write and read the euro symbol from other applications (like Microsoft Office).

My problem is in the SQL Server databases.
It is possible saves into a varchar(8000) the euro symbol, with out to make this column unicode --> nvarchar(4000)?

I'm very interested in know taht.

Thanks.
EVA JANAKIEFF
 
As I said

on my m/c
char(128)
is an ascii euro symbol.

That may be something to do with the o/s, euro patch or collation - I suspect it's the client euro patch.
This is the standard code for the euro though so you could use this as your replacement character.
That will allow you to store 8000 chars but as soon as you try to use a unicode character in a replace statement it will turn the result into a unicode string with a max of 4000 chars though so you would have to deal with that - split into two strings maybe.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top