Image string select in sql server table

  • Hi All,

              my tbale have a 150000 records i this records some of records have images.how can i select only image records from table .
    For example my table like this.

    high heels
    🚈
    high heel wedges
    high heeled boots
    🚊
    🚍
    high heels boots for women
    heysham port train station parking
    🚎
    🚐
    🚔
    hga group

    Final i want the only image records like
    🚈
    🚊
    🚍
    🚎
    🚐
    🚔

    Regards
    Pols

  • polo.csit - Thursday, July 27, 2017 4:36 AM

    Hi All,

              my tbale have a 150000 records i this records some of records have images.how can i select only image records from table .
    For example my table like this.

    high heels
    🚈
    high heel wedges
    high heeled boots
    🚊
    ðŸš
    high heels boots for women
    heysham port train station parking
    🚎
    ðŸš
    🚔
    hga group

    Final i want the only image records like
    🚈
    🚊
    ðŸš
    🚎
    ðŸš
    🚔

    Regards
    Pols

    Can you post your sample data as insert statements?
    You might be able to get it by something like this:

    SELECT *
    FROM SomeTable
    WHERE Somecolumn NOT LIKE '%[a-zA-Z0-9]%'

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • but some records 

    ??????? ???? ??????
    ?????????
    ????? ??? ???? ?????? ??????????
    ??????????
    ???????????????????

  • SELECT *
    FROM SomeTable
    WHERE Somecolumn NOT LIKE '%[a-zA-Z0-9]%'

    it is not working

  • Luis Cazares - Thursday, July 27, 2017 5:40 AM

    Can you post your sample data as insert statements?

    Well, you haven't posted what I asked. I have no idea what are you storing and querying.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • polo.csit - Thursday, July 27, 2017 6:18 AM

    SELECT *
    FROM SomeTable
    WHERE Somecolumn NOT LIKE '%[a-zA-Z0-9]%'

    it is not working

    In addition to what Luis is telling you, it's important that you understand that just saying "it is not working", doesn't tell anyone anything that will help them help you.   We need to know much more detail.   You need to at the very least provide the details of the data types of the columns in your table, and ideally, some sample data (not real data), as a combination of a CREATE TABLE statement and INSERT statements that will provide the sample data.   That way, people can at least simulate what you are trying to do and have a chance at helping you get things working.   When you just say you have a problem, but don't provide any details, you have to remember that we can't know anything about your environment.   When one poster suggested a particular query, they were doing so in the hope you would realize you need to customize it to fit the specific column names you actually have in your table.   We have no indication as to whether or not you actually understand that.   Help us help you.   Be extremely detailed about what is taking place, and what you've already tried.

  • insert into data(id,name)
    values(@id,@name)

  • polo.csit - Thursday, July 27, 2017 7:11 AM

    insert into data(id,name)
    values(@id,@name)

    While this is the right idea, we still don't know the data types because you didn't provide a CREATE TABLE statement.   Also, you have two variable that you didn't DECLARE, so we don't have data types for those either.  We can't help you if you can't be more specific as to what your table actually looks like.   We don't need your actual data, just mocked up sample data that at least simulates the conditions you are up against.  However, we HAVE to know the data types, ,as well as know exactly what 1 record in the given table actually represents.

  • create table data(id int,name nvarchar(max))

    declare @id int,@name nvarchar(max)

    set @id =1
    set @name='abcd'(some images)

    insert into data(id,name)
    values(@id,@name)

    here insert is not a problem.after insert we separate the images that is main task for me.

  • polo.csit - Thursday, July 27, 2017 7:31 AM

    create table data(id int,name nvarchar(max))

    declare @id int,@name nvarchar(max)

    set @id =1
    set @name='abcd'(some images)

    insert into data(id,name)
    values(@id,@name)

    here insert is not a problem.after insert we separate the images that is main task for me.

    INSERT IS A PROBLEM. If we can't insert those images into our test database, we CAN'T give you a tested answer. If you're unwilling to cooperate, I'll be unwilling to help.
    Read the articles in my signature before posting something else.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • polo.csit - Thursday, July 27, 2017 7:31 AM

    create table data(id int,name nvarchar(max))

    declare @id int,@name nvarchar(max)

    set @id =1
    set @name='abcd'(some images)

    insert into data(id,name)
    values(@id,@name)

    here insert is not a problem.after insert we separate the images that is main task for me.

    There are still problems here.   Specifying SET @name='abcd'(some images) doesn't represent "sample data".  Further, you're using an nvarchar(max) variable and field to hold image data ?  That's not typically how images are stored in a database, unless you're converting the image data elsewhere because you store a character representation of the hex values, which is horrendously inefficient as you're using at least 4 bytes just to store 1 byte of image data in that case.   Also, if you're storing image data after some text value, what kind of delimiter will always exist in every record that has an image, that will separate the image data from the text data?

  • I believe, by "images" the OP actually means emoticons, which have a unicode value. These don't display well (at all?) if you're running Windows 7 or prior sometimes, as they didn't exist in the standard unicode when the OS was released.

    So the OP is looking for nvarchar values such as:
    ??????????????????
    (They were just random emoticons I grabbed from the emoticons keyboard.)

    Either way, like everyone has said, we need Sample data. Considering that the OP has implied that there could be non western characters as well, we need amore clarity.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply