Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get a specific range of bytes in the varbinary data?

Tags:

tsql

How can I get a specific range of bytes in the varbinary data?

For example length of varbinary data is 128 and I want to get only 15-19 bytes.

like image 215
mkus Avatar asked Jan 03 '12 09:01

mkus


1 Answers

SELECT SUBSTRING(VarbinaryColumn, 15, 5)

15 being the first position and 5 the length.

More information:

  • SUBSTRING (Transact-SQL)
like image 58
Andriy M Avatar answered Oct 12 '22 23:10

Andriy M