DBAWinnipeg
Programmer
Good Morning 
I'm trying to write a neat little script that will go through all my linked servers and get me the free space and total space on the drives.
so I can run this statement fine
EXEC LINKED_SERVER.master.dbo.xp_fixeddrives
but when I start trying to do this type thing
EXEC @hr= LINKED_SERVER.master.dbo.sp_OACreate 'Scripting.FileSystemObject',@fso OUT
EXEC @hr = EXEC @hr = CCLEPOSTTST.master.dbo.sp_OAMethod @fso,'GetDrive', @odrive OUT, @drive.master.dbo.sp_OAMethod @fso,'GetDrive', @odrive OUT, @drive
I get this message
Server: Msg 10019, Level 16, State 1, Line 36
sp_OACreate has not yet been called successfully for this command batch.
but the line that executes the sp_OACreate doesn't error out at all....
any ideas?
Thanks in advance!!!
Colin in da 'Peg
I'm trying to write a neat little script that will go through all my linked servers and get me the free space and total space on the drives.
so I can run this statement fine
EXEC LINKED_SERVER.master.dbo.xp_fixeddrives
but when I start trying to do this type thing
EXEC @hr= LINKED_SERVER.master.dbo.sp_OACreate 'Scripting.FileSystemObject',@fso OUT
EXEC @hr = EXEC @hr = CCLEPOSTTST.master.dbo.sp_OAMethod @fso,'GetDrive', @odrive OUT, @drive.master.dbo.sp_OAMethod @fso,'GetDrive', @odrive OUT, @drive
I get this message
Server: Msg 10019, Level 16, State 1, Line 36
sp_OACreate has not yet been called successfully for this command batch.
but the line that executes the sp_OACreate doesn't error out at all....
any ideas?
Thanks in advance!!!
Colin in da 'Peg