2009-08-13 77 views
0
SELECT 
     (SELECT Grade 
     FROM DB2..Students 
     WHERE DB2..Students.studentnumber=DB1..Students.studentnumber    
      AND ISNULL(Students.Disable,'') != 'T' 
    ) as test,* from DB2..Students 

WHERE studentnumber IN 
     (SELECT studentnumber FROM DB2..Students where    
      AND ISNULL(studentnumber,'') !='' 
     AND ISNULL(Students.Disable,'')  != 'T' 
) 

怎么回事?无法绑定多部分标识符“DB1..Students.studentnumber”

我收到一个错误:“多部分标识符”DB1..Students.studentnumber“无法绑定。”

请帮
感谢

+0

对不起没有提及..我正在使用SQL服务器 – Mithil 2009-08-13 19:47:17

回答

1

你似乎是使用名为“学生”两个表。一个在DB1中,一个在DB2中。您在您的WHERE子句中引用DB1..Students,但不在您的FROM子句中。

+0

是的..我没有以适当的方式形成查询。非常感谢! – Mithil 2009-08-13 20:17:27

+0

好的。我从来没有意识到, ..

与dbo架构一起工作良好。 – JamesMLV2009-08-13 21:27:37

相关问题