Problem convert varbinary to float

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

    Problem convert varbinary to float

    Hello I have some problems with converting varbinary to float in T-SQL
    stored procedure. In my C# application i have table of structures with
    double type fields. Size of this table is variant. I have to send this
    table to SP. Because of performance i want to send it only once and
    whole. So I have to cut this varbinary blob in my Stored procedure to
    receive structure field values. But I have problems with double fields
    - conversion from varbinary to float in T-SQL is not allowed. Please
    halp me - thx for any advise.
    Maciej
  • Erland Sommarskog

    #2
    Re: Problem convert varbinary to float

    Maciej (maciej_ty@pocz ta.onet.pl) writes:[color=blue]
    > Hello I have some problems with converting varbinary to float in T-SQL
    > stored procedure. In my C# application i have table of structures with
    > double type fields. Size of this table is variant. I have to send this
    > table to SP. Because of performance i want to send it only once and
    > whole. So I have to cut this varbinary blob in my Stored procedure to
    > receive structure field values. But I have problems with double fields
    > - conversion from varbinary to float in T-SQL is not allowed. Please
    > halp me - thx for any advise.[/color]

    It is not clear how you send this table to SQL Server, but it sounds
    like you are sending a binary string. This sounds messy.

    The best is probably to format the data as XML, and then use
    sp_xml_prepeare document and OPENXML to unpack the data on the SQL Server
    side.


    --
    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...