Questions tagged [varbinary]
varbinary is the SQL Server datatype used to hold variable-length binary data
37 questions
0 votes
1 answer
75 views
Is it better for performance, to create a separate filegroup for tables that contain blobs? [closed]
I am currently working on an application that has approximately 500,000 users. Each user has a profile picture averaging around 32KB in size. I am using SqlServer and I want to save these profile ...
0 votes
1 answer
87 views
Explanation needed for my result
I am new to string handling in SQL server and was wondering what makes the below code return the result it returns. Could I please have a detailed explanation? My code: Select CAST(CAST(CAST('08' as ...
1 vote
1 answer
239 views
Rolling up multiple varbinary(max) rows into a single row
My table looks something like this: BinFiles 0x1101ABB1C... 0x2202DEE2F... 0x3303GHH3I... I tried this to get a single line: SELECT STUFF((SELECT d.BinFiles FROM dbo.demo d WHERE d.ID = dd....
5 votes
2 answers
810 views
Varbinary update attempt
Is it possible to adapt this into update query which has to seek a free sequence of 3 bytes or (0x000000) and replace it with a new sequence if the data is split like this every 3 bytes? The issue is ...
2 votes
1 answer
2k views
Varbinary pattern search
I'm trying to make a query which goes through varbinary data. The issue is that I can't really finish what I'm trying to achieve. What you should know about the column is varbinary(50) and the ...
1 vote
1 answer
1k views
LIKE or match by beginning for binary strings in PostgreSQL
I need to match a binary column with its beginning. For text columns it's easy: LIKE 'image/%'. This uses BTREE index if any. Is it possible to do this also using an index for a binary column? BTW, I ...
0 votes
1 answer
404 views
Detecting whether a varchar value is already encrypted by EncryptByPassPhrase() in SQL Server
Starting with a varchar(100) column named Password in a table Users with one record in it, after performing an update on the column to encrypt it with EncryptByPassPhrase() on the Password column the ...
2 votes
1 answer
852 views
Why can't binary data be inserted/displayed as ones and zeroes?
If I have a column of type binary or varbinary, I imagine the data as a sequence of bits. For example, it makes sense to me that 01001 (as a base 2 number) could be a valid value in a binary(5) column....
1 vote
0 answers
667 views
Speed up reading data from a table
Problem We have a table that has just 44 rows, and one of the columns is varbinary(max). This column stores XML files converted to varbinary(max). Average length of data in this particular column is ...
1 vote
2 answers
5k views
How does SSMS display varbinary data?
When you store a .jpg file in a varbinary(max) column and then view the data in SQL Server Management Studio, it appears like "0xFFD8FFE000..." Is this Hex Encoded or something? What is SQL ...
3 votes
3 answers
808 views
Varbinary startswith query using index
I've got this tree-like key (think object OIDs--it's very similar) to store and index in a table, for which queries want to select subtrees thereof. The most straightforward way to do this on a btree ...
0 votes
1 answer
774 views
VARCHAR automatically changes to VARBINARY
I am new to MySQL. When I declare a column as VARCHAR, why does it automatically change to VARBINARY? How should I avoid this? Database changed ...
0 votes
1 answer
546 views
How can I decrypt data on a replicated MSSQL database?
I have a database which uses a symmetric key to encrypt a credit card field. There is a trigger on the credit_card field which runs every time it is updated, to encrypt the contents, and save it to ...
4 votes
1 answer
6k views
Insert String Value To Binary(64) Column
I am attempting to use a stored procedure to insert data into a table. The DDL of my table is like this: CREATE TABLE [dbo].[data1]( [ID] [int] IDENTITY(1,1) NOT NULL, [fname] [varchar](100) ...
0 votes
2 answers
8k views
BLOB or VARBINARY to store simple Strings that are converted into byte[ ]?
I've read that In MySQL, BLOBs are often used to store image files, file path pointers, video & audio files, and any other big data objects. But can BLOBs be used for simple Strings that are ...