0

Probably more information is needed, but this is really odd. Using SQL 2005 I am executing an Inner Join on two tables. If I rename one of the tables (using Alter Table), the resulting Query Plan is significanly longer. There are views on the table, but the Inner Join is using the base table, not any of the views. Does this make sense? Is this to be expected?

Neil Weicher
  • 2,370
  • 6
  • 34
  • 56
  • 1
    When you say, *‘but the Inner Join is using the base table’*, are you talking about the query or the query plan? – Andriy M May 28 '12 at 07:29
  • Are the views [Indexed Views](http://msdn.microsoft.com/en-us/library/ms191432.aspx)?. Do you recreate the views when you rename the table? – Mikael Eriksson May 28 '12 at 07:41
  • @MikaelEriksson: I may be missing something but if the table was used by an indexed view, the OP wouldn't be able to rename it (without dropping the view first). (Indexed views are created with schema binding.) – Andriy M May 28 '12 at 07:47
  • 1
    One other question: how exactly does your `ALTER TABLE` statement look? I think it's the first time I hear that `ALTER TABLE` can be used to *rename tables*. – Andriy M May 28 '12 at 07:51

0 Answers0