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 as another table

Author  Topic 

jamie
Aged Yak Warrior

542 Posts

Posted - 2006-12-15 : 09:57:01
hi,
when I run create table archive as (Select * from logs where date<01/01/2006)
I receive the error :
Incorrect syntax near the keyword 'AS'.

do you know why?
regards
jamie

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2006-12-15 : 10:04:20
Select *
Into Archive
From Logs
Where date < '01/01/2006')
Go to Top of Page

jamie
Aged Yak Warrior

542 Posts

Posted - 2006-12-15 : 10:38:53
cheers,
can't beleive I was trying the oracle way !
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-15 : 10:53:17
If data in your table is huge, this will place locks on the system tables. Instead of that, create table explicitly first and then insert data.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-15 : 11:16:30

1 The source table wont have indices, constraints,etc
2 Precreate table and insert data

Madhivanan

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

- Advertisement -