Click here to Skip to main content
15,745,014 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to transfer value from one table to another table.
Here, the code is executing but it inserting into separate row..
pls tel how to check the where condition for inserting into particular row.

"insert into test1(photo) select content from dbo.test test1 where ID = 1"

In this code containing where for getting value from particular row

you can not override any existing row with insert query.

Insteade you can update the same and you can do it with help of update join query to.

Jitendra Kumar
Share this answer

Make a update query with inner join
example query here:

update dbo.test1  set photo=t.content from dbo.test1 as t1 inner join dbo.test as t on t1.regno='13'
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900