-3

create table tableB as ( select * from tableA) --this works in oracle but not in sql server

Avula
  • 11
  • 1
  • the above given answers show duplicating records only!! I want to create a table along with the column names @Rob – Avula Aug 09 '17 at 03:36
  • What do you mean by duplicating records only? It inserts all the columns and rows into the table; which is exactly what you ask in your title. – Rob Aug 09 '17 at 03:37
  • does it create a new table because my tableB does not exist @rob – Avula Aug 09 '17 at 03:45
  • Yes, those answers will create `tableB` with the same columns, and insert all the data into it from `tableA`. – Rob Aug 09 '17 at 03:45

1 Answers1

1

Use into like this:

Select * into TableB from TableA.
Vijunav Vastivch
  • 4,153
  • 1
  • 16
  • 30