Messages I hate…

I run a simple query against a group of databases using the multiple connection feature in SSMS 2008.  Nothing too complicated, just trying to see which (if any) databases are annoying me with a particular feature:

sp_msforeachdb 'if databasepropertyex(''?'', ''IsAutoShrink'') = 1 SELECT ''?'''

And I find, rather than a nice, simple set of results showing server & databasename, half a dozen resultsets, and lots of instances of the following message:

Server(Domain\UserID): An error occurred while executing batch. Error message is: This server returned a fewer number of result sets than other responding servers. This may impact the ability to properly merge results.

Yuck.  “A fewer number of result sets”?  Come on, Microsoft, you can write better English than that, surely?  Or, and here’s a radical idea, just merge the results properly in the first place…

This entry was posted in SQLServerPedia Syndication, Uncategorized and tagged . Bookmark the permalink.

5 Responses to Messages I hate…

  1. Chris Stamey says:

    I agree. What I have found works is piping the results into a temp table then selecting from the temp table works perfectly.
    If OBJECT_ID(‘TempDB..#Temp’, ‘U’) > 0
    Drop Table #Temp
    Create Table #Temp (DBName VarChar(255))
    Insert Into #Temp
    Exec sp_msforeachdb ‘if databasepropertyex(”?”, ”IsAutoShrink”) = 1 SELECT ”?”’
    Select * From #Temp
    Drop Table #Temp

  2. Neil Roberts says:

    Awesome workaround! Thanks.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.