I came across some strange SMO errors today running my SMOscript utility on a new SQL Server 2008 database (10.0.2531.0):
Error: An exception occurred while executing a Transact-SQL statement or batch.
Error: Could not find stored procedure ‘msdb.sys.sp_getProcessorUsage’.
A web search did not yield any results.
It turned out that the code was calling Server.Initialize(false) twice, and removing one of the calls caused the program to run without raising exceptions.
Since the last version of SMOscript is dated May 2010, and I have some files created by SMOscript dated July 2010, some magic event must have caused a different behavior in the SMO libraries. I have no idea.