Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8793507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:07:52+00:00 2026-06-13T23:07:52+00:00

I’m trying to find specific lines of data from a BINARY column. Example data

  • 0

I’m trying to find specific lines of data from a BINARY column.

Example data in the BINARY(2000) column:

0x0600700701000C006B6173616E74696E676B6F000000000003000A0078009C0000000000E612101E000000000000000000006B031813361E00000000000000000000D4014B13141C0000000000000000000053017C13261E00000000000000000000A102E113361E000000000000000000009E02FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2201073200000000000000000000D604D11C101C000000000000000000008C01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0170000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000220047003700280016000F0001000B0003003F000000480200001D0000003101000000000000562B00003710000000000000134B000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB517010000000000000000000000000012060200000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF191404000000000000000000000000009A13051D00000000000000000000A0029A13051D00000000000000000000A002BC3B0700000000000000000000000000FE050817000000000000000000000000FE05091E00000000000000000000000012060200000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF191404000000000000000000000000009A13051D00000000000000000000A0029A13051D00000000000000000000A002FB050F0D000000000000000000000100FB05101E000000000000000000000100FB05111E000000000000000000000100FE13121D00000000000000000000B402FE13121D00000000000000000000B402E213141E00000000000000000000BC02E213141E00000000000000000000BC023613161D00000000000000000000FE003613161D00000000000000000000FE00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB05191E000000000000000000000100FE13121D00000000000000000000B402FE13121D00000000000000000000B402E213141E00000000000000000000BC02E213141E00000000000000000000BC023613161D00000000000000000000FE003613161D00000000000000000000FE000413201E00000000000000000000CC000413201E00000000000000000000CC002E01222C000000000000000000008F052E01222C000000000000000000008F05FB05241E000000000000000000000100FB05251E000000000000000000000100FB05261E000000000000000000000100FB05271E0000000000000000000001000413201E00000000000000000000CC000413201E00000000000000000000CC002E01222C000000000000000000008F052E01222C000000000000000000008F05FB052C1E000000000000000000000100FC052D1E000000000000000000000000A9262E2E000000000000000000000000A9262E2E000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E01222C000000000000000000008F052E01222C000000000000000000008F05FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9262E2E000000000000000000000000A9262E2E000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000005E000000000000000000000000000000000000000500000000000000FFFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

This data has 1 result of 2201 somewhere in it. (try searching the data for 2201 and you will get 1.)

Now I’m trying to use this query: (it should give me 512 rows of results)

SELECT * 
FROM table
WHERE binaryfield LIKE '%2201%'
ORDER BY key

But no luck in getting results.

Notes: 2201 actually is 290. I’m trying to look for the decimal value 290 which is 2201 in hex in the data that is in endian.

Update:

Tried this query (searching for: 15584)

SELECT *
FROM CHAR_DATA1
WHERE CHAR_DATA LIKE '%'+CAST(0xE03C AS nvarchar(MAX))+'%'
ORDER BY CHAR_KEY;

Now its returning almost all rows. Even manually checked the rows for E03C but none was found, but when running the query it gets returned. very odd. ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:07:53+00:00Added an answer on June 13, 2026 at 11:07 pm

    The LIKE operator only works on character data types. Try doing a CAST to a string, like this:

    SELECT * 
      FROM table
     WHERE CAST(binaryfield AS nvarchar(MAX)) LIKE '%290%'
     ORDER BY key;
    

    — or —

    SELECT * 
      FROM table
     WHERE CAST(binaryfield AS nvarchar(MAX)) LIKE '%'+CAST(0x2201 AS nvarchar(MAX))+'%'
     ORDER BY key;
    

    Also, if you want to look at a subset of the data (e.g. the file header), you can do something like this:

    SELECT * 
      FROM table
     WHERE CAST(LEFT(binaryfield, 8) AS nvarchar(MAX)) -- Only compares the first 8 bytes
             LIKE '%'+CAST(0x2201 AS nvarchar(MAX))+'%'
        OR CAST(SUBSTRING(binaryfield, 34, 4) AS nvarchar(MAX)) -- Compares bytes 34-38
             LIKE '%'+CAST(0x2201 AS nvarchar(MAX))+'%'
     ORDER BY key;
    

    Edit

    Regarding your updated question, does this give you the results that you’re expecting:

     SELECT *
       FROM CHAR_DATA1
      WHERE CHAR_DATA COLLATE SQL_Latin1_General_CP1_CI_AS
              LIKE '%'+CAST(0xE03C AS nvarchar(MAX))+'%'
     ORDER BY CHAR_KEY;
    

    You shouldn’t have to cast/convert the character data to binary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.