UPDATE in two INNER JOINed tables in SQL Server Compact 4

I am trying to update values ​​between two tables in sql server compact edition 4.0. My sql is as follows:

UPDATE ei SET ei.EstateID=e.EstateID FROM EstateImages ei
    INNER JOIN Estates e ON e.TempKey=ei.TempKey

Also tried the following:

UPDATE EstateImages SET EstateID = 
    (SELECT EstateID FROM Estates WHERE TempKey = EstateImages.TempKey)

I have a mistake:

There was an error parsing the query.
[ Token line number = 1, Token line offset = 37, Token error = SELECT ]
+3
source share
3 answers

If you check the e-book or other links, you will find that this is not done in SQL Server CE.
- No FROM clause
- No correlated subqueries

In principle, the only data that the UPDATE statement can reference is the data in the updated row.

, , :
1. ,
2. ,

, CE ( ) . , T-SQL, IF , SQL.

, UPDATE ; . , , , .

"", CE " ". - ( funk) .

, , , . .

+6

SQL:

  • ( )
  • temp, ( , , , , )
  • SQL .

: , # 3, , ... " SQL Server Compact 4.0 API". http://msdn.microsoft.com/en-us/library/ms172364(SQL.110).aspx

+1

I had the same problem with the DELETE operation, but I sorted it this way.

DELETE FROM exSetData 
WHERE EXISTS 
(
       SELECT * FROM Exercise 
       WHERE Exercise.Name = exSetData.exName 
       AND Exercise.Day = @name
)

We hope that it will be useful for you while you work in UPDATE. Food for thought may be ...

-1
source

All Articles