Tags: annoyed, bound, database, identifier, level, microsoft, mistake, msg, multi-part, mysql, oracle, server, silly, sql, stuff, stupid

Msg 4104 Level 16 The multi-part identifier X could not be bound.

On Database » Microsoft SQL Server

1,553 words with 4 Comments; publish: Wed, 09 Jan 2008 11:25:00 GMT; (25093.75, « »)

this is so stupid and simple and I am annoyed over having to spend so much on this silly simple stuff.

I am sure I am just making a silly mistake.

I am trying to remove records from one table. The table holds 19000 something records.

To determine WHICh records to delete, I have another table that contains the 45 I want to delete.

So I wrote this very simple query

Delete from tbl_X

where tbl_X.FieldA = tbl_Y.FieldA;

The message I get is:

Msg 4104, Level 16, State 1, Line 1

The multi-part identifier "tblY.FieldA" could not be bound.

Please tell me I am stupid!

Thanks!

All Comments

Leave a comment...

  • 4 Comments
    • tbl_Y needs to be mentioned as a table in a FROM clause or a JOIN clause. Perhaps you want something like

      DELETE FROM tbl_X

      WHERE tbl_X.FieldA IN (SELECT FieldA FROM tbl_Y)

      HTH,

      Don

      #1; Wed, 03 Oct 2007 01:13:00 GMT
    • I've always coded a delete like this as a join:

      DELETE tbl_X

      FROM tbl_X INNER JOIN tbl_Y

      ON tbl_X.FieldA = tbl_Y.FieldA

      #2; Wed, 03 Oct 2007 01:14:00 GMT
    • THANKS!

      And thanks for the quick reply!

      Richard

      #3; Wed, 03 Oct 2007 01:15:00 GMT
    • THANKS!

      And thanks for the quick reply!

      Richard

      #4; Wed, 03 Oct 2007 01:16:00 GMT