How to update column from another table column in sqlserver compact 4.0?

Chao Yang 41 Reputation points
2021-09-08T07:26:03.52+00:00

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?

Developer technologies Transact-SQL
SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. EchoLiu-MSFT 14,621 Reputation points
    2021-09-09T06:09:49.46+00:00

    Hi @Chao Yang

    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.


1 additional answer

Sort by: Most helpful
  1. Viorel 122.5K Reputation points
    2021-09-08T17:00:27.88+00:00

    Try some different statements, for example:

    update table1 
    set table1.column1 = 
        (select table2.column1 from table2 where table2.column2 = table1.column2)
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.