Ahsan Mumtaz Abbasi
Ahsan Mumtaz Abbasi

Reputation: 63

Execute stored procedure by using link server

I'm facing a problem. I have these 3 servers:

1 Server1
2 Server2
3 Server3

I want to create a job on Server1 which will send email in html format include drives spaces xp_fixeddrives of all three servers.

Please help me - what will be best scenario to achieve this?

Upvotes: 0

Views: 3791

Answers (1)

ASP
ASP

Reputation: 666

If you have linked server for server2 & server3 in server1 then you can execute like below

EXEC master.dbo.xp_fixeddrives
EXEC Server2.master.dbo.xp_fixeddrives
EXEC Server3.master.dbo.xp_fixeddrives

Best approach is run the powershell script from SQL job. please check the below example https://gallery.technet.microsoft.com/scriptcenter/PowerShell-and-Notification-50630dc9

Upvotes: 0

Related Questions