Copy rows from one table to another


/ Published in: SQL
Save to your folder(s)

Just replace the squared brackets with the correct values.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.