341129 visitors has seen the Tim-Carter.com site. Thanks!
364 visitors has seen the Tim-Carter.com site today.
 
 
Search :  
 
>>> Programming >> MSSQL > SQL How to update a table with values from another table? (This page has been seen 502 times)

SQL How to update a table with values from another table?

Lets say you have created a table and want to copy some data from a table to your new table, you could do something like this.

UPDATE T
      SET Field1 = c.Field1
      , Field2 = c.Field2
      , Field3 = c.Field3
      , Field4 = c.Field4
      , Field5 = c.Field5
FROM MyTable T
JOIN MyTable2 C
ON T.ID = C.ID



Like
 
Dislike


Post comment

Name:


Comment:

Code Language:

Code:

Here you can paste a code example. It will then be processed by SyntaxHighlighter and formatted for easier readability.
Please remember to select the correct Code Language in the select above so the SyntaxHighlighter can highlight the code properly.




Code:

Please enter the code you see above

What is 1 + 4 =

Submit Comment


No one has commented on this page yet. You could be the first.


Advertisement by Google