SQL Sever Data FAQ

Source: Internet
Author: User
Tags sql server books server memory

One, the execution of stored procedure memory continues to not degrade, the solution.

ALTER procedure [dbo]. [Clearmemory]
As
Begin
--Clear all caches
DBCC Freeproccache
DBCC Freesessioncache
DBCC Freesystemcache (' all ')
DBCC dropcleanbuffers
--Open Advanced Configuration
exec sp_configure ' show advanced options ', 1
--Set the maximum memory value to clear the existing cache space
exec sp_configure ' max server memory ', 512
EXEC (' RECONFIGURE ')
--Set wait time
WAITFOR DELAY ' 00:00:01 '
--Reset the maximum memory value
EXEC sp_configure ' max server memory ', 6000
EXEC (' RECONFIGURE ')
--Turn off Advanced configuration
exec sp_configure ' show advanced options ', 0
End

Ii.SQL Server blocked the STATEMENT ' OpenRowset for component ' Ad Hoc distributed Queries ' ...

Error: msg 15281, Level 16, State 1, line 1th SQL Server blocked access to the statement ' Openrowset/opendatasource ' of component ' Ad Hoc distributed Queries ' because this component was shut down as part of this server's security configuration. System administrators can enable ' Ad Hoc distributed Queries ' by using sp_configure. For more information about enabling ' Ad Hoc distributed Queries ', see "surface Area Configurator" in SQL Server Books Online.

WORKAROUND:--Enable AD Hoc distributed Queries: New query, input

exec sp_configure ' show advanced options ', 1

Reconfigure

exec sp_configure ' Ad Hoc distributed Queries ', 1

Reconfigure

--Close ad Hoc distributed Queries after use is complete:

exec sp_configure ' Ad Hoc distributedqueries ', 0

Reconfigure

exec sp_configure ' show advanced options ', 0
Reconfigure

 

  

SQL Sever Data FAQ

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.