以下のコードは MS Access では正常に動作しますが、SQL Server 2008 では動作しません。
UPDATE Borrow INNER JOIN BorrowDetails
ON Borrow.BorrowID = BorrowDetails.BorrowID
SET BorrowDetails.Returned = True
WHERE BookID = 1 AND MemberID = 1
任意のアイデアをお願いします。
以下のコードは MS Access では正常に動作しますが、SQL Server 2008 では動作しません。
UPDATE Borrow INNER JOIN BorrowDetails
ON Borrow.BorrowID = BorrowDetails.BorrowID
SET BorrowDetails.Returned = True
WHERE BookID = 1 AND MemberID = 1
任意のアイデアをお願いします。
UPDATE BorrowDetails
SET BorrowDetails.Returned = True
FROM BorrowDetails
INNER JOIN Borrow ON Borrow.BorrowID = BorrowDetails.BorrowID
WHERE BookID = 1 AND MemberID = 1
代わりにこれを試してください:
UPDATE bd
SET bd.Returned = 1
FROM BorrowDetails bd
INNER JOIN Borrow b ON bd.BorrowID = b.BorrowID
WHERE b.BookID = 1 AND b.MemberID = 1
UPDATE x
SET x.Returned = True
FROM (
SELECT Returned
FROM Borrow INNER JOIN BorrowDetails ON Borrow.BorrowID = BorrowDetails.BorrowID
WHERE BookID = 1 AND MemberID = 1
) x