2012-08-14 46 views
0

我有下面的語句作爲DB2.dbo.in_table.ID不會綁定一個存儲過程列將不綁定

As 
BEGIN 
SET NOCOUNT ON 
    DELETE DB1.dbo.Members WHERE DB1.dbo.members.ID = DB2.dbo.in_table.ID 
    --after the delete I will insert all of the new data from in_table to Members 
END 

的第一步。存儲過程被設置爲存儲在DB2上。 DB1位置完美綁定。這是數據庫權限問題嗎?

回答

1

您沒有引用或在查詢中的任何位置加入第二個表:

DELETE 
FROM DB1.dbo.Members 
WHERE EXISTS (SELECT ID 
       FROM DB2.dbo.in_table 
       WHERE DB1.dbo.Members.id = B2.dbo.in_table.ID) 
+0

完美。謝謝 – 2012-08-14 19:43:31