locked
The multi-part identifier "Winter.jpg" could not be bound. RRS feed

  • Question

  • User500621135 posted

    SQL gods, I need your help:

    I have one table "info" 

    table1 columns: name,contact,imagename

    What I'm doing is deleting a row when "Imagename=Sunset.jpg"  Here is my sql script:

    Delete from info where imagename=Sunset.jpg

    When I run the script, I get this error:

    Multi-part identifier "Sunset.jpg" could not be bound

    What am I doing wrong?  Please help.

    KAMAL

    Monday, July 18, 2011 8:36 AM

Answers

  • User-718146471 posted

    Well, if you want to delete that way, you need to specify text like this:

    Delete from info where imagename='Sunset.jpg';
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 8:55 AM
  • User560403387 posted

    Sunset.jpg is a string and needs single quotes:

    DELETE FROM info WHERE imagename='Sunset.jpg'

    It's probably a good idea to have a look at the basics of SQL.

    Menno

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 8:56 AM
  • User-718146471 posted

    You have to remember that when you specify a string, you must put it inside quotes. If not, the database will think you are specifying a column name. Numbers do not have this limitation. Usually, DBAs will use the record id instead of a string. The problem with using a string is you could have multiple entries in the database that have the same imagename.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 9:01 AM
  • User500621135 posted

    thanx to all for replying..i got the solution after putting this on the forum ..... but really say thanx for replying me and suggesting me

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 19, 2011 12:13 AM

All replies

  • User-718146471 posted

    Well, if you want to delete that way, you need to specify text like this:

    Delete from info where imagename='Sunset.jpg';
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 8:55 AM
  • User560403387 posted

    Sunset.jpg is a string and needs single quotes:

    DELETE FROM info WHERE imagename='Sunset.jpg'

    It's probably a good idea to have a look at the basics of SQL.

    Menno

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 8:56 AM
  • User-718146471 posted

    You have to remember that when you specify a string, you must put it inside quotes. If not, the database will think you are specifying a column name. Numbers do not have this limitation. Usually, DBAs will use the record id instead of a string. The problem with using a string is you could have multiple entries in the database that have the same imagename.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 9:01 AM
  • User500621135 posted

    thanx to all for replying..i got the solution after putting this on the forum ..... but really say thanx for replying me and suggesting me

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 19, 2011 12:13 AM