I'm connected to 4 servers in one query on my CMS. I want to run this query on each server and insert the data into a database/table on my CMS server.
How do I access my CMS database(dbstats) when SSMS can only see I am connected to 4 servers I am querying through one query window?
DECLARE @driveSpace TABLE (drive CHAR(2), MBFree int)
INSERT INTO @driveSpace
EXEC sp_executesql N'xp_fixeddrives'
INSERT INTO [CMSServerName]..dbstats..daychecklist ----< cannot see this reference!
SELECT 'Drive Space', GETDATE(), 'Free space on ' + drive + ' is ' + CONVERT (VARCHAR(20), MBFree/1024) + ' Gigs'
FROM @driveSpace