Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 The multi-part identifier could not be bound

Author  Topic 

pras2007
Posting Yak Master

216 Posts

Posted - 2009-04-01 : 20:44:29
Hello All,

I'm trying execute the statement below, but I keep getting the error:

Server: Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "DTG_S.dbo.USER_TABLE.USER_ID" could not be bound.

Update statement:

UPDATE [Data].[dbo].[ENT]
SET ENT.RM_USER_ID = DTG_S.dbo.USER_TABLE.USER_ID
SELECT ENT.ENT_ID, ENT.LAST_NAME, ENT.FIRST_NAME, ENT.RM_USER_ID, DTG_S.dbo.USER_TABLE.USER_ID,
ENT.FIRST_NAME AS Expr1, ENT.LAST_NAME AS Expr2
FROM ENT INNER JOIN
DTG_S.dbo.USER_TABLE ON ENT.LAST_NAME = ENT.LAST_NAME AND ENT.FIRST_NAME = ENT.FIRST_NAME
WHERE (ENT.ALSO_KNOWN_AS IS NOT NULL) AND (ENT.DELETED_FLAG = 0) AND (ENT.ENT_TABLE_ID = 1047) AND (ENT.RM_USER_ID = 0)

Please advice.

THanks.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-04-01 : 22:59:50
you have two seperate statements there. First an incomplete UPDDATE statement because there is not FROM clause. Then a SELECT statement which looks ok at first glance. This would be a complete UPDATE statement although I don't know if it is what you need:

UPDATE [Data].[dbo].[ENT]
SET ENT.RM_USER_ID = DTG_S.dbo.USER_TABLE.USER_ID
FROM ENT INNER JOIN
DTG_S.dbo.USER_TABLE ON ENT.LAST_NAME = ENT.LAST_NAME AND ENT.FIRST_NAME = ENT.FIRST_NAME
WHERE (ENT.ALSO_KNOWN_AS IS NOT NULL) AND (ENT.DELETED_FLAG = 0) AND (ENT.ENT_TABLE_ID = 1047) AND (ENT.RM_USER_ID = 0)

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -