host variables and code page conversion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aakash Bordia

    host variables and code page conversion

    Hello,
    Does anybody know what is the documented and known behavior of
    inserting/updating binary columns using host variables from a client to a
    server which have different code pages? Will any code page / character set
    conversion take place? I am particulary interested in insert/update from
    subqueries.

    eg:
    insert into t1(binarycol) select :HV1 from t2
    versus
    insert into t1(binarycol) select :HV1||charcol from t2

    update t1 set bytecol=:HV1
    versus
    update t1 set bytecol=:HV1||' abc'

    insert into t1 (bytecol) values(:HV1)
    versus
    insert into t1 (bytecol) values(:HV1||'a bc')

    Is the conversion dependent on the context?
    Thanks
    Aakash



  • Erland Sommarskog

    #2
    Re: host variables and code page conversion

    Aakash Bordia (a_bordia@hotma il.com) writes:[color=blue]
    > Does anybody know what is the documented and known behavior of
    > inserting/updating binary columns using host variables from a client to a
    > server which have different code pages? Will any code page / character set
    > conversion take place? I am particulary interested in insert/update from
    > subqueries.[/color]

    In SQL Server there is no implicit conversion from character to
    binary.

    You seem to be using some form of embedded SQL, and this product
    might supply such conversion. In this case I would expect the conversion
    to binary happen on the client side, and thus the binary value will
    reflect the code page on the client.

    But this is speculation on my part. You are probably off testing to
    see what happens.


    --
    Erland Sommarskog, SQL Server MVP, sommar@algonet. se

    Books Online for SQL Server SP3 at
    SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

    Comment

    Working...