I have a binary field in SQL Server which I want to read one byte at time in a SQL function. In code I would use a byte array. Is there an equivalent in SQL?
I couldn’t find anything with google.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The SUBSTRING function should be sufficient. A quick example, assuming table MyTable with column SomeData, binary(10) not null:
There are fancier set-based ways to do this, but for short values this should be adequate.