converting Varchar details into nvarchar of my table

  • hai friends ,

    i am create on table like

    create table wish

    (

    id int identity,

    name nvarchar(100),

    city varchar(100),

    comments nvarchar(max)

    )

    insert into wish values('rama','chennai','happy birthdy')

    i ve inserted the wishes also in tamil telgu like hindhi

    unfortunately i m inserted value in web page in varchar mode enter the comments of tamil its diplay like ??????

    now i wanna retrive nvacrhar of tamil .....

    how to modify the data varchar data into nvarchar alrdy inserted

  • To convert varchar to nvarchar you can use CAST or CONVERT function.

    However you don't need to convert values inserted into nvarchar column, as they already will be converted on insert.

    If you want to insert/state that string is a nvarchar use this:

    insert into wish values(N'rama','chennai','happy birthdy')

    N prefix tells to SQL Server that the string is of nvarchar type.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • I think that what you're saying is that you entered characters like this on your web interface -- "????" (forgive me if that means something, I was hoping for gibberish as I just copy and pasted random characters from the web)

    And what you've found has been stored in your database is -> "?????"

    So your question is "how can you convert the nonsense string back into the originally entered data?".

    I'm afraid that, AFAIK, your data is lost. I suspect that your web application is to blame. It might be worth attempting to insert more similar data whilst having SQL Profiler running so that you can see what the web application passed to the database.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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