Skip to main content
1 of 2

How can copy one column data of one table1 into other table2 column and other clumns table2 empty?

Here is my problem.I have two tables 'Stdd' and 'result'. 'stdd' have fields id,fname,lname,gender,phonenum,city AND 'result' have columns physics,chem,math,english,urdu,bio,total,id. I want that in 'result' table id copy data from 'stdd' id and other columns(fields) of 'result' columns remain empty or null.How can i do this please help. I try this but nor works for me

       update result set  id= (select id from stdd)

following error come

       Msg 512, Level 16, State 1, Line 1
       Subquery returned more than 1 value. This is not permitted when  the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
       The statement has been terminated.

I want this kind of output.Here is 'result' table link

I'm using microsoft sql server 2008