We help IT Professionals succeed at work.
Get Started
Research Question

TADOStoedProc - how to pass a large data value to a varbinary column via a Stored Procedure parameter

Roger Alcindor
Last Modified: 2020-12-03
I am using embarcadero C++ Builder XE10.1 to write an application that needs to store data in a Varbinary column in a database table by using a stored procedure.
the database column is Varbinary(MAX). My question is how to to use the stored procedure parameter to insert the data into the table. the data in the C++ application is stored in a TMemoryStream *ms

For example , my C++ code will be something like the following (the ?? is what I don't know what to code, whatever it is should include the size of the binary data that will be stored ):

The C++ code:
ADOStoredProc1->Parameters->ParamByName(u"BigData")->Value = ??.

The Stored Procedure:

@bigdata varbinary(MAX)




   INSERT TestImageStore (imagedata)

   VALUES (@bigdata)



I could achieve what I want by appending the table and setting the field after an Append operation but I wish to use a stored procedure.

Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE