Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Also if i change the order of these joins would that impact the results
kjv1611 said:I've been told/taught that as far as the order goes, it's best to start with the smallest table if at all possible, if you're looking for the best performance.
Is there a way to tell if statistics have been updated?
Declare @Temp Table(RowId Int Identity(1,1), Table_Name VarChar(200), Statistic_Name VarChar(200))
Insert Into @Temp(Table_Name, Statistic_Name)
Select Object_Name(Object_Id) As Table_Name, Name
From sys.indexes As Ind
Inner Join Information_Schema.Tables Tab
On Object_Name(Ind.Object_Id) = Tab.Table_Name
Create
Table #Output(Name VarCHar(200), [Updated] DateTime, Rows Int, [Rows Sampled] Int, Steps Int, Density Float, [Average Key Length] Float, [String Index] VarChar(20))
Declare @Table VarChar(200)
Declare @Stat VarChar(200)
Declare @Row Int
Declare @Max Int
Select @Row = 1, @Max = Max(RowId) From @Temp
While @Row <= @Max
Begin
Select @Table = Table_Name, @Stat = Statistic_Name
From @Temp
Where RowId = @Row
If @Table Is Not NULL And @Stat Is Not NULL
Insert Into #Output Exec ('DBCC show_statistics (''' + @Table+ ''',''' + @Stat + ''') WITH STAT_HEADER')
Set @Row = @Row + 1
End
Select * From #Output
Drop Table #Output