Posted By

choasis on 12/28/09


Tagged

copy rows T-SQL


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Copy rows from one table to another


 / Published in: SQL
 

Just replace the squared brackets with the correct values.

  1. INSERT INTO [TABLE2] AS T2 (NOLOCK) (T2.[VAL1], T2.[VAL2], ...)
  2. SELECT T1.[VAL1], T1.[VAL2], ...
  3. FROM [TABLE1] AS T1 (NOLOCK)
  4. WHERE T1.[VAL1] = T2.[VAL1]

Report this snippet  

You need to login to post a comment.