I would like to achieve it.
Update table1 set table1.column1 = table2.column2
from table1, table2
where table1.column2 = table2.column2
How to achieve it in sqlserver compact 4.0?
I would like to achieve it.
Update table1 set table1.column1 = table2.column2
from table1, table2
where table1.column2 = table2.column2
How to achieve it in sqlserver compact 4.0?
Try some different statements, for example:
update table1
set table1.column1 =
(select table2.column1 from table2 where table2.column2 = table1.column2)
Error Code: 80040E14
Message : There was an error parsing the query. [ Token line number = 3,Token line offset = 7,Token in error = select ]
Minor Err.: 25501
Source : SQL Server Compact ADO.NET Data Provider
Num. Par. : 3
Num. Par. : 7
Err. Par. : select
I've tried all the answers on the Internet, but I can't.
sqlserver compact 4.0 doesn't support update 'FROM' / update 'SELECT'
@ChaoYang-1684 You are right, sqlserver compact 4.0 doesn't support update 'FROM' / update 'SELECT' based on Books On-Line entry for UPDATE
You'd have to assign a value to a variable in one query, then use the variable to do the update in the second, thus you may try Cursors to achieve it.
Oh, it's too hard. 'You cannot declare variables in SQL Compact's SQL dialect.'
Hi @ChaoYang-1684,
Welcome to the microsoft TSQL Q&A forum!
Sorry, I am not familiar with sqlserver compact, and I have not found a relevant forum to help you.
But I found some solutions, maybe it can help you:
UPDATE on two INNER JOINed tables in SQL Server Compact 4
How to do Sql Server CE table update from another table
If you have any question, please feel free to let me know.
If the response is helpful, please click "Accept Answer" and upvote it.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
4 people are following this question.
Year and Month aggregation in same Pivot table in SQL Server
SQL Server Query for Searching by word in a string with word breakers
How to show first row group by part id and compliance type based on priorities of Document type?
Query to list all the databases that have a specific user
T-sql query to find the biggest table in a database with a clustered index