Git Product home page Git Product logo

Comments (8)

TimelordUK avatar TimelordUK commented on September 23, 2024

does something like below force it to return a buffer - for a varbinary column it should not attempt to map to a string, but it probably drops to string by default, what is the actual column definition.

select cast(buffer_param as varbinary(1000)) from [dbo].[buffer_param_test] as raw_data

from node-sqlserver-v8.

Jeff-14159 avatar Jeff-14159 commented on September 23, 2024

the above is working nicely but only for 1000 ..... if using (3000)+ or (max) it stops trying to buffer and just spits out the string? how to make this work for data larger that 2000?

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on September 23, 2024

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on September 23, 2024

Looking at the driver code looks like I will have to take a look at this. I don't think it currently handles larger than 2k binary columns as you have discovered. I will try to get a fix out as soon as possible in coming days.

from node-sqlserver-v8.

Jeff-14159 avatar Jeff-14159 commented on September 23, 2024

the source column type is "image". With the cast it was successfully converting it to the varbinary type.

No rush on this now I was able to do the conversion in SQL first with this:

SET ARITHABORT ON
SELECT
ReportID AS ReportID,
CAST(N'' AS XML).value('xs:base64Binary(xs:hexBinary(sql:column("PDFData")))', 'VARCHAR(MAX)') AS PDFEncoded
FROM (
SELECT RPT.ReportID,
CONVERT(VARBINARY(max),RPT.PDFImage) AS 'PDFData'
FROM Reports AS RPT
WHERE RPT.ReportID='00001'
) AS rtp_temp

Thanks,
Jeff

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on September 23, 2024

I found cause of this issue it will be fixed in next version. Thanks for showing me how to reproduce it.

from node-sqlserver-v8.

TimelordUK avatar TimelordUK commented on September 23, 2024

this is now fixed on latest version 0.4.5

from node-sqlserver-v8.

Jeff-14159 avatar Jeff-14159 commented on September 23, 2024

Thank you for your quick responses on the initial trouble shooting and continued support on this module.

Thanks,
Jeff

from node-sqlserver-v8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.