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)
 Create TAble

Author  Topic 

sunitagoswami
Starting Member

10 Posts

Posted - 2006-12-12 : 08:36:32
When I am trying to execute this statement in the "Northwind" database in SQL SERVER 2000
Create table #temp as
(select * from Orders)
I am getting error as
Incorrect syntax near the keyword 'as'.
Please advice...



Sunita

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-12 : 08:38:28
This is a MS SQL Server forum!

select *
into #temp
from orders

If you have other DBMS, please post in www.dbforums.com


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-12 : 11:44:27

1 The target table wont have the indices, constraint, etc
2 Locking issue should be considered if there are millions of table
3 Better to precreate table and then insert data to it

Madhivanan

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

- Advertisement -