Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

CMS Query Error Suppression Expand / Collapse
Author
Message
Posted Tuesday, February 19, 2013 10:15 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, August 11, 2014 12:41 PM
Points: 541, Visits: 1,045
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


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?
Post #1421747
Posted Tuesday, February 19, 2013 1:27 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, August 11, 2014 12:41 PM
Points: 541, Visits: 1,045
*bump*
Post #1421831
Posted Wednesday, February 20, 2013 9:49 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, August 11, 2014 12:41 PM
Points: 541, Visits: 1,045
*bump* Really? Has no one ever tried to do this?
Post #1422163
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse