how to write coding to convert data from one table to another [Resolved]

Posted by Amritha444 under Sql Server on 5/2/2011 | Points: 10 | Views : 1246 | Status : [Member] | Replies : 1
Hi all

I want to convert data from one table to another by using cursor

My case is

I have table App_Profile and have data's in it i want to convert datas corresponding to particular id to another table emp_Profile.There may be more than one rows for each id...whatever be the number i want whole data corresponmding to that id to another table ..

Can anybody suggest idea i want to write code in backend side

Thanks in advance




Responses

Posted by: T.saravanan on: 5/2/2011 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Hi,

Try this one.....

insert into table2 (Id,Name)

select nID,sName from table1 where nID = 2


In this query table1--> Input Table
table2 --> Output Table




Thanks,
T.Saravanan

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response