How do you copy an image data type (or varbinary(max)) from one table to another in SQL Server, without having to save the data to a file first?
Steps that need to be followed are:Launch SQL Server Management Studio. Select and right-click on the Source Database, go to Tasks > Export Data. Import/Export Wizard will be opened and click on Next to proceed. Enter the data source, server name and select the authentication method and the source database.
If you want to copy the data of one SQL table into another SQL table in the same SQL server, then it is possible by using the SELECT INTO statement in SQL. The SELECT INTO statement in Structured Query Language copies the content from one existing table into the new table.
You select the records from one table and insert into another. As you do it in the same query, the data doesn't leave the database, so you don't have to store it anywhere.
Example:
insert into SomeTable (SomeId, SomeBinaryField)
select SomeId, SomeBinaryField
from SomeOtherTable
where SomeId = 42
You can make at as complex as you like.
I prefer parsing the same field in the same field using a select statement to copy image data from one table to an other.
Update [Database].[dbo].[DataTableA$Attachment]
SET [Store Pointer ID] = (SELECT [Store Pointer ID]
FROM [Database].[dbo].[DataTableB$Attachment]
WHERE [No_] = '35975') WHERE [No_] = '35975'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With