Questions tagged [varbinary]

varbinary is the SQL Server datatype used to hold variable-length binary data

SQL Server's varbinary datatype is declared with a length specification in the CREATE TABLE statement:

CREATE TABLE tablename (..., colName varbinary(n), ...)

where n is the maximum size of the column in bytes (limited to a maximum of 8000), or the word MAX if more than 8000 bytes might need to be stored. (The absolute maximum size is approximately 2gb as of this writing; consult SQL Server documentation for the exact current maximum.)

For more information, see this entry in the SQL Server online documentation.

411 questions
-1
votes
2 answers

Push file to sql server stored proc to save in Blob, then retrieve said file

I have found a lot of references to how to save a file to a blob field (VARBINARY), but they all seem to require that the sql server have access to the file on the file system. Our web server resides on a different machine and unfortunately there's…
Christopher Johnson
  • 2,629
  • 7
  • 39
  • 70
-1
votes
1 answer

sql convert varchar and varbinary with c#

here is my c# code on a button click: Int32 fileLen; fileLen = uplImage.PostedFile.ContentLength; Byte[] input = new Byte[fileLen]; myStream = uplImage.FileContent; …
dwarf
  • 445
  • 2
  • 9
  • 23
-1
votes
3 answers

Convert a varbinary to a DateTime in C#

I had a datetime column in a SQL Server table. We needed to encrypt it. So, I cast it to a varbinary in SSMS. I simply edited the table, set the datetime type to varbinary and let SQL Server convert it. Following that, I wrote throwaway C# code to…
alphadogg
  • 12,762
  • 9
  • 54
  • 88
-2
votes
1 answer

Why is my code unable to convert string to bytes using python and SQL server

For hours I have been trying to save my python file image to my database table but to no avail due to conversion issue with an error notification of: Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT…
CCCC
  • 241
  • 2
  • 10
-3
votes
0 answers

How to get PDF file stored in SQL Server

I have stored a PDF file in SQL Server table with the following commands now I want to get the same file from the table can you please tell me how do I get this PDF file in the readable format. create table attachments ( srno int ,…
-6
votes
2 answers

Display image in php page from sql database

I'm trying to display image in php page from a SQL database. When i try i see: ÿØÿàJFIFHHÿáWExifMM* instead of the image that I expected. Please Help me to read or display this as an image.
Sukumol
  • 1
  • 1
  • 2
1 2 3
27
28