Groups | Blog | Home
all groups > sql server programming > july 2004 >

sql server programming : Create table with select *


roshan
7/1/2004 11:40:02 PM
Hi Anyone know how to perform a create table like it is done in oracle

Create table xyz as
(select * from A,B where a.id=b.id)

oj
7/1/2004 11:46:38 PM
select *
into xyz
from A,B
where a.id=b.id

[quoted text, click to view]

Rohtash Kapoor
7/1/2004 11:49:53 PM
Example:

--This will create a new table called MyTable and copy all the records
froms Authors table.
SELECT * INTO MyTable FROM Authors

--This will create a new table called YourTable without copying any
records from Authors table
SELECT * INTO YourTable FROM Authors
WHERE 4=5

Rohtash Kapoor
http://www.sqlmantra.com



[quoted text, click to view]

Hari
7/2/2004 12:04:43 PM
Hi,

use the below syntax.

select * into table_name from table_a,table_b where ........

--
Thanks
Hari
MCDBA
[quoted text, click to view]

AddThis Social Bookmark Button