Collecting DBCC SHOWFILESTATS output from linked server

  • Hello I am trying to execute DBCC SHOWFILESTATS againt linked server and return data into table on my server. I tried to use OPENQUERY but I got an error:'Could not process object 'DBCC SHOWFILESTATS'. The OLE DB provider 'SQLOLEDB' indicates that the object has no columns.'. I also tried to create temporary table on remote server and inserting DBCC SHOWFILESTATS in it. but it didn't work either.
     
    Any help would be greately appreciated.
     
    Igor
  • Have you tried to make a SP on the Linked Server and execute it OVER the linked server?

    EXEC LinkedServer.Database.Owner.mySPThatReturnsTheResultOfMyDBCC

    //Hanslindgren

  • Unfortunately, INSERT INTO <table_name> EXEC <sp_name> will not work because SQL Server generates an error: An INSERT EXEC statement cannot be nested. I am capturing DBCC SHOWFILESTATS as INSERT INTO <table_name> EXEC('DBCC SHOWFILESTATS') inside stored procedure. I suppose there is no easy work around, is there?

     

    Thanks,

    Igor

  • Does this SP actually exist on the remote server or on the local server?

  • It does exist on remote server. I have found a workaround. I made stored procedure on remote server dump data into local tables.My main procedure is calling proc on remote server and the get data from tables on remote server using INSERT INTO ... SELECT FROM.

  • I am abit suspicious that it didn't work in the other way but whatever works is a solution

Viewing 6 posts - 1 through 5 (of 5 total)

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