none
The multi-part identifier could not be bound. RRS feed

  • Question



  • Hi,

    Can someone help me as to why the following SQL is cause the error:

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

    STORE PROCEDURE

    Create Table #tWorkorder
    (
    tID INT IDENTITY,
    WorkId int,

    )

    INSERT INTO #tWorkorder(WorkId)   
    SELECT WOId  FROM dbo.VM_WorkOrders WHERE (VM_WorkOrders.BuyerId=1) and (VM_WorkOrders.WOStatusId=3) and
    (VM_WorkOrders.BuyerId = 1) AND (VM_WorkOrders.WOStatusId = 3) and (VM_Resources.FName = 'devi')

    drop table #tWorkorder


    Error Msg.

    Server: Msg 4104, Level 16, State 1, Line 8
    The multi-part identifier "VM_Resources.FName" could not be bound.

    Thanks & Regards
    N.VARUN KUMAR.
     



    Friday, February 8, 2008 6:04 AM

All replies

  •  

    Hi Varun,

    Simple way to solve this issue is, need to provide an alias name for your table.

    For ex: if this is ur query "SELECT WOId  FROM dbo.VM_WorkOrders WHERE (VM_WorkOrders.BuyerId=1) and "

    need to change like this

    SELECT t1.WOId  FROM dbo.VM_WorkOrders t1 WHERE (t1.BuyerId=1).

     

    I hope, this will help u to fix.

     

     

    Thanks & Regards,

    Karthikeyan Murthy

     

    Tuesday, March 25, 2008 5:28 AM
  • Hi,

     

    I stumbled upon this post because I was getting a similar error, the problem I was having has the same cause as this case, you are trying to filter the information in your SELECT QUERY part with a filed that belongs to a table that is not contemplated in the FROM clause.

     

    INSERT INTO #tWorkorder(WorkId)   
    SELECT WOId  FROM dbo.VM_WorkOrders WHERE (VM_WorkOrders.BuyerId=1) and (VM_WorkOrders.WOStatusId=3) and
    (VM_WorkOrders.BuyerId = 1) AND (VM_WorkOrders.WOStatusId = 3) and (VM_Resources.FName = 'devi')

    Server: Msg 4104, Level 16, State 1, Line 8
    The multi-part identifier "VM_Resources.FName" could not be bound.

    Regards,

    Ivo Valente

    Friday, May 2, 2008 5:19 PM
  • Hi, I am getting the same error.

    "Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "..." could not be bound."

    But I was using the JOIN operator in the Select statement; when I changed it by bringing in the joining table to the FROM clause and included my joining condition onto the WHERE condition, it worked fine.

    Hope this Helps,

    God bless,

    Sam


    Regards, Sam Aaron
    Wednesday, May 19, 2010 3:59 PM
  • Hello.  I have the following proc:

     

    USE [IISLogs]
    GO
    /****** Object:  StoredProcedure [dbo].[ShowInetLogs]    Script Date: 04/04/2011 10:14:59 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[ShowInetLogs]

    AS
    BEGIN

        SET NOCOUNT ON;
    /****** Script for SelectTopNRows command from SSMS  ******/
    SELECT [ClientHost]
          ,[ipinfo].[ResolvesTo]
          ,[username]
          ,[LogTime]
          ,[service]
          ,[machine]
          ,[serverip]
          ,[processingtime]
          ,[bytesrecvd]
          ,[bytessent]
          ,[servicestatus]
          ,[win32status]
          ,[operation]
          ,[target]
          ,[parameters]
      FROM [IISLogs].[dbo].[InterNetLog]
      INNER JOIN ipinfo ON ipinfo.IPAddress = internetlog.ClientHost
      ORDER BY LogTime ASC

     

    END

    It gets created successfully but when I try to execute it I get  the following:

    Msg 4104, Level 16, State 1, Line 3
    The multi-part identifier "ipinfo.ResolvesTo" could not be bound.

     

    Anyone have any ideas?  This is SS 2008R2 I am working with.  When I execute the query in the sql editor, it works correctly.


    pcgalen
    Monday, April 4, 2011 3:39 PM