SQL Server Error: The multi-part identifier companyinfo.status could not be bound

Last Reply 10 months ago By dharmendr

Posted 10 months ago

i have the following SP and I wanted to check the value of companyinfo.status and  i have used select companyinfo.status...but getting the error...

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

What should i use to see the value of column?

-- ***********************UPDATE STATUS ******************************
UPDATE companyinfo 
SET companyinfo.status=RESULT.status
FROM
(	
		select XMLProdTable.status,XMLProdTable.compId
		from 
			OPENXML(@hDoc, 'master/TRANSACTION', 2)   
				 WITH (
						compId varchar(200),                 
						
						status bigint				
					
					  ) XMLProdTable
	LEFT OUTER JOIN companyinfo COMPANY ON XMLProdTable.compId=COMPANY.dataID	
	where --cmp.status !=8 And	
	COMPANY.status !=1 AND 
	COMPANY.status < 6 AND
	XMLProdTable.status < COMPANY.status
) AS RESULT
WHERE companyinfo.dataID=RESULT.compId
IF @@ERROR<>0 BEGIN ROLLBACK TRANSACTION RETURN -101 END
select companyinfo.status

 

Posted 10 months ago
chetan says:
select companyinfo.status

To see the result you have to use From companyinfo and where clause, that is missing in your select statement.

select companyinfo.status From companyinfo WHERE companyinfo.dataID=RESULT.compId