-3

I'm a new in Microsoft SQL, so just lab with the database name "test" , and 1 table imported from excel named "dbo.Sheet1$", so i would like to clone the current table, I wrote the query script like below:

use test;
create table newtable as select * from dbo.Sheet1$

I got the message:

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'select'.

Could you please help assist on this ?

Thom A
  • 88,727
  • 11
  • 45
  • 75
van thang
  • 99
  • 2
  • 9

1 Answers1

2

Maybe try this

use test;

select * into newtable from dbo.Sheet1$

you can read more about SELECT INTO here

DhruvJoshi
  • 17,041
  • 6
  • 41
  • 60