omacron
Technical User
- Feb 5, 2002
- 149
Hi, Using MS SQL 2005
I am trying run the following script;
I am getting this error;
I have try running this to enable it;
That gives me this error message;
No I have found where to change this in Microsoft SQL Server 2005 => COnfiguration Tool => SQL Server 2005 Surface Area Configuration. This does fix my issue now but I need way to change this via a script so its much easier to configure future databases.
I am trying run the following script;
Code:
SELECT * into header FROM OPENROWSET('SQLOLEDB', 'IP Address';'sa';'Sa Password',
'SELECT * FROM DBName.dbo.header')
Code:
Msg 15281, Level 16, State 1, Line 1
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.
Code:
EXEC sp_configure 'Ad Hoc Distributed Queries', '1'
Code:
Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51
The configuration option 'Ad Hoc Distributed Queries' does not exist, or it may be an advanced option.
No I have found where to change this in Microsoft SQL Server 2005 => COnfiguration Tool => SQL Server 2005 Surface Area Configuration. This does fix my issue now but I need way to change this via a script so its much easier to configure future databases.