Varchar Vs NVarchar

  • i have a table with below columns / datatypes

    col1 varchar10

    col1 varchar30

    col1 varchar100

    col1 varchar50

    col1 varchar4000

    i want to convert all varchar to Nvarchar, can i use same data length like below

    col1 nvarchar10

    col1 nvarchar30

    col1 nvarchar100

    col1 nvarchar50

    col1 nvarchar4000

    Col1 - varchar (10) - Value is "SQL Server"

    can the same value will store in nvarchar also.

  • Yes. The number in brackets is the number of characters that the column can hold. NVarchar(10) can hold 10 characters, "SQL Server" is 10 characters, so it'll fit.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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