Skip to content

Instantly share code, notes, and snippets.

@PJensen
Created October 12, 2012 18:05
Show Gist options
  • Select an option

  • Save PJensen/3880579 to your computer and use it in GitHub Desktop.

Select an option

Save PJensen/3880579 to your computer and use it in GitHub Desktop.
Updating a table using a source and destination table.
-- Updating a table using a source and destination table.
BEGIN TRAN
UPDATE [ToTable]
SET [ToTable].[Value] = [FromTable].[Value],
...
FROM [FromTable]
INNER JOIN [ToTable] ON ( /* Join Conditions */ )
WHERE ( /* Where Clause */ )
ROLLBACK TRAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment