Click to See Complete Forum and Search --> : Copy sepecific data between tables in the same database


mrtblt
03-25-2009, 01:47 PM
I have a two table lets say a and b. And from table b i want to copy only values of field1,field2 and field3 to table a's fieldx,fieldy and fieldz. Both tables have more than 3 fields. How i can do this

BrainDonor
03-25-2009, 02:18 PM
try this (this worked in SQL Server 2005):

insert into a (fieldx,fieldy,fieldz) select field1, field2, field3 from b