CMS Query Error Suppression

  • I'm not sure if there is a specific ability in queries against server groups or if there is something more generic but my Google-Fu turned up WAY too many results..

    Essentially I need to get a return on my query despite the errors I get. For example, I have a server group created in the CMS that contains 25 servers with various versions of SQL on them, ranging from SQL 2000 to SQL 2012.

    So a query like this...

    select * from sysdatabases where name = 'someTable'

    will return

    server1(ABC\ME): Msg 208, Level 16, State 1, Line 3

    Invalid object name 'sys.databases'.

    server2(ABC\dsvramsay): (11 row(s) affected)

    server3(ABC\dsvramsay): (6 row(s) affected)

    server4(ABC\dsvramsay): (14 row(s) affected)

    ....ETC[/QUOTE]

    because there is no sys.databases in SQL Server 2000, just sysdatabases. I've tried using if (select @@version) switches to no avail either. I can't use if exists(select * from sys.ojbects) because, of course, there is no sys.objects in 2000, just sysobjects.

    Any thoughs on how to force ssms to give me the results for the parts of the query that DO run?

  • *bump*

  • *bump* Really? Has no one ever tried to do this?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply