Query against two tables in separate databases on the same server

Viewed 63262

I need to query two tables in two different databases on the same SQL Server. On one table, I need to get all the rows (simple select) and on the other, a select but where the id matches a parameter in my stored proc.

I tried doing this but get the error

The multi-part identifier could not be bound.

How can I go about this?

QUERY:

  SELECT QUALITY_CENTER, POSTCODE_ID, (SELECT   [QCID]   
  FROM [Website_Interactive].[dbo].[IIPCentre_UserObject]
  WHere LoginID = @loginID)
  FROM IIP_QC_LIST
4 Answers
Related