1、sp_recompile 说明:使存储过程和触发器在下次运行时重新编译 原因:存储过程和触发器所用的查询只在编译时进行优化。对数据库进行了索引或其它会影响数据库统计的更改后,已编译的存储过程和触发器可能会失去效率。通过对作用于表上的存储过程和触发器进行重新编译,可以重新优查询。 方法:执行下面的脚本就可以将数...
begin exec sp_recompile @objName fetch next from #_cursor into @objName end close #_cursor deallocate #_cursor print '完成' 2、sp_refreshview 说明:刷新指定视图的元数据。由于视图所依赖的基础对象的更改,视图的持久元数据会过期 原因:修改完表,相应的视图没有发生变化是很痛苦的事情,或许这个是微软...
在 SQL Server Profiler 集合中,會記錄事件 SP:CacheInsert ,而不是事件 SP:Recompile。 Transact-SQL 語法慣例 語法 syntaxsql 複製 sp_recompile [ @objname = ] N'object' [ ; ] 引數 [ @objname = ] N'object' 目前資料庫中預存程式、觸發程式、數據表、檢視或使用者定義函數的限定或...
SP:Recompile 事件類別指出已重新編譯預存程式、觸發程式或使用者定義函式。 這個事件類別所報告的重新編譯會在語句層級發生。 追蹤語句層級重新編譯的慣用方式是使用 SQL:StmtRecompile 事件類別。 SP:Recompile 事件類別已被取代。 如需詳細資訊,請參閱 SQL:StmtRecompile 事件類別。 SP:Recompile 事件類別數據行...
Sqlserver:sp_recompile的副作用,在sqlserver中,有一个系统存储过程:sp_recompile,可以强制对访问recompile【存储过程、触发器、表、视图】进行访问的相关的sql语句进行重新编译执行计划! 如果object是存储过程或触发器的名称,那么该存储过程或触发器将在下次运行时
浅谈mssql2000的sp_recompile和sp_refreshview 1、sp_recompile 说明:使存储过程和触发器在下次运行时重新编译 原因:存储过程和触发器所用的查询只在编译时进行优化。对数据库进行了索引或其它会影响数据库统计的更改后,已编译的存储过程和触发器可能会失去效率。通过对作用于表上的存储过程和触发器进行重新编译,...
Transact-SQL syntax conventions Syntax syntaxsql sp_recompile[ @objname = ]N'object'[ ; ] Arguments [@objname= ] N'object' The qualified or unqualified name of a stored procedure, trigger, table, view, or user-defined function in the current database.@objnameisnvarchar(776), with no ...
那么现在我们发现了问题,接下来让我们看一下可能的解决方案… Solution #1 – sys.sp_recompile 很简单就是使用系统存储过程sys.sp_recompile从缓存中移除指定的执行计划或者所有计划引用的指定表和视图 Soluti
SP_RECOMPILE Article 03/12/2008 This event type or event group can be specified when you create Event Notifications to monitor and respond to activity in the database or server instance. Event notifications can be created directly in the SQL Server Database Engine or by using the WMI ...
The SP:Recompile event class is deprecated. For more information, see SQL:StmtRecompile Event Class.SP:Recompile Event Class Data ColumnsIšplėsti lentelę Data column nameData typeDescriptionColumn IDFilterable ApplicationName nvarchar Name of the client application that created the connection...