Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 append

Author  Topic 

jailiamanisha
Starting Member

1 Post

Posted - 2006-06-27 : 02:39:48
hii frens i am new member in this group .i hv problem that i hv 2 table contain same attributes i want to append second table in first one in sql server.

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2006-06-27 : 02:48:33
[code]INSERT INTO table1 (col1, col2, col3)
SELECT col1, col2, col3
FROM table2[/code]
or if you want a new table (table3 in this case) containing both tables' records:[code]
SELECT col1, col2, col3
INTO table3
FROM table1
UNION ALL
SELECT col1, col2, col3
FROM table2[/code]


Mark
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-27 : 03:52:06
If it is for display then

Select columns from table1
Union all
Select columns from table2

Alternatively you can create view having this query and use that view

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -