zoukankan      html  css  js  c++  java
  • Question[SQL]: The Fastest Way to Recompile All Stored Procedures

    Question: The Fastest Way to Recompile All Stored Procedures

      I have a problem with a database running in SQL Server 6.5 (Service Pack 4). We moved the database (object transfer) from one machine to another last night, and an error (specific to a stored procedure) is cropping up. However, I can't tell which procedure is causing it. Permissions are granted in all of our stored procedures; is there a way from the isql utility to force all stored procedures to recompile?

         Tips: sp_recompile can recomplie a store procedure each time

    Answer:在执行存储过程时,使用 with recompile 选项强制编译新的计划;使用sp_recompile系统存储过程强制在下次运行时进行重新编译

    USE AdventureWorks;
    GO
    EXEC sp_recompile N'Sales.Customer';
    GO

    这样可以使与表'Sales.Customer'相关的存储过程在下次运行时重新编译。

  • 相关阅读:
    ES6 import、export的写法
    不带分号可能会引起出错的情况
    npm传参技巧
    深度优先遍历和广度优先遍历
    WebGL的shader
    web component
    页面的beforeunload和unload的事件应用
    暴搜
    子集树与排列树
    概率论
  • 原文地址:https://www.cnblogs.com/chenjunbiao/p/1760186.html
Copyright © 2011-2022 走看看