I found these statements somewhere on the internet. I have used them in order to be able to pull date from msdb..sp_help_job into a temporary table so I can determine what jobs are executing at the current time. I'm a little leery about doing this on a production server since by default this parameter was turned off. I'm thinking that the Ad Hoc distributed queries option here is the key one. I was wondering what the negative ramifications are of turning this on. And why the almost duplicate Show Advanced Options statements? Does one turn on override and then the other turns it off again?
EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE
EXEC sys.sp_configure N'Ad Hoc Distributed Queries', N'1'
go
RECONFIGURE WITH OVERRIDE
go
EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE
go
EXEC sys.sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE
EXEC sys.sp_configure N'Ad Hoc Distributed Queries', N'1'
go
RECONFIGURE WITH OVERRIDE
go
EXEC sys.sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE
go