Any way to avoid prefixing N character for unicode support

  • I have to support unicode data storage and retrieval in my application

    My database tables already have nchar, nvarchar columns.

    As per my knowledge, I have to prefix the values for these columns with N character in my insert/update/select statements.

    But my existing select, inserts and update statements do not have the N character prefixed to the values.

    Is there any way that I can set up some parameter or change configuration at the database server level so that I do not need to change all my SQLs to prefix the unicode data with N character?

  • In order to avoid loss of information, all literals need to be prefixed with N and all variables need to be defined as nchar, nvarchar and ntext. Variables includes declared variables and all stored procedure parameters.

    For example, if you insert into column defined as nchar(1) the literal character value for the Euro, '€' , then when you select the nchar column, the Euro symbol is not returned.

    SQL = Scarcely Qualifies as a Language

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply