Hi,
I am new to sql programming. I have created a table tbl1 with 50 rows. I created another table tbl2 with 50 rows. Both tables have same structure but different set of data. I want to swap the column LastName from the two tables. This is I am doing for creating sample names. Is there any simple way to do it?
I tried insert statement like this...
insert into #tbl1(lname)
select lname from #tbl2
which gives me error. Basically, I just want to swap the lname from two tables so that I can produce some fake names. I also tried with update statement, but it puts only same name in all rows.
Can somebody suggest a way to do it? That will be a great help!
Thanks in advance!
ndp
I am new to sql programming. I have created a table tbl1 with 50 rows. I created another table tbl2 with 50 rows. Both tables have same structure but different set of data. I want to swap the column LastName from the two tables. This is I am doing for creating sample names. Is there any simple way to do it?
I tried insert statement like this...
insert into #tbl1(lname)
select lname from #tbl2
which gives me error. Basically, I just want to swap the lname from two tables so that I can produce some fake names. I also tried with update statement, but it puts only same name in all rows.
Can somebody suggest a way to do it? That will be a great help!
Thanks in advance!
ndp