0

I am using SQL Server 2008 R2. I am creating a table using

Select.. 
Into... 
From

where the From is actually 2 joined tables.

Will the resultant table have the indexes of the original tables?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
DeveloperM
  • 1,129
  • 7
  • 17
  • 30

1 Answers1

3

Well, you could try this yourself and see. But the answer is no. It will have a table schema consisting of the columns and types in the Select clause, but no indexes, foreign keys or anything from the source table(s).

Randy Minder
  • 47,200
  • 49
  • 204
  • 358
  • Thanks, Randy. I created a non-clustered index after the fact. – DeveloperM Jul 25 '14 at 15:07
  • it helps to right click objects in the object explorer of SSMS (if you use that) and the click "SCRIPT for..." and then choose "CREATE in". This can be done with tables, indexes and a lot more. Saves time but needs proper adjustment of names of new objects. – Der U Jul 25 '14 at 15:19