Copy data between rows in the same table

So here was my issue. I needed to copy some <binary data> from one row in a table to another row. I tried using the SQL Server Managment Studio but it does not allow you to copy and past binary information. Instead I used a UPDATE... FROM SQL statement.

Here is an example:

UPDATE LoadTestRun
SET LoadTest = b. LoadTest
FROM LoadTestRun, LoadTestRun b
WHERE LoadTestRun.LoadTestRunID = 4 AND b.LoadTestRunID = 1  

Here is the generic format:

UPDATE table
SET field = b.field
FROM table, table b
WHERE table.PirmaryKeyID = "Copy To ID" AND b.PrimaryKeyID = "Copy From ID"  

Comments

  1. VidMate App is a powerful video and music downloader that allows users to save content from popular platforms like YouTube, Facebook, Instagram, and TikTok. The app supports HD and 4K downloads, offline playback, and fast downloading speeds with a simple user-friendly interface.

    ReplyDelete

Post a Comment

Popular posts from this blog

Add User As Local Administrator On Domain Controller

An error occurred while applying security information to

Install/Configure Power Apps Mobile for U.S. Government and DoD User