Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

256 Posts

Posted - 03/14/2013 :  08:39:51  Show Profile  Reply with Quote
Hi all

I'm trying to sort out stats and indexes on our server and I'm running a test on 3 tables to start with (three of our biggest).
I've got the stats bit sorted, but I can't get the code to rebuild the indexes on the 3 specific tables.
This is the code I'm using:-

exec sp_updatestats
exec sp_MSforeachtable '
if  in (''FACT_iApplicationStat'',''FACT_iAgentBySkillsetStat'',''FACT_iAgentPerformanceStat'')


I'm getting the following error:-
Msg 207, Level 16, State 1, Line 2
Invalid column name '[dbo].[FACT_iApplicationStatSummary]'.
when it starts the index rebuild.

Can anyone see where I'm going wrong?
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.01 seconds. Powered By: Snitz Forums 2000