Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个要重新编译的存储过程。在 Live 环境中这样做是否安全?因为存储过程和 SQL Server 2008 正在处理连续的数据流。
根据所使用的方法(即不要使用该WITH RECOMPILE选项删除并重新创建过程),这在 Live 环境中执行是完全安全的。
WITH RECOMPILE
如果使用sp_recompile,存储过程将被简单地标记为导致在下一次执行时计算新的查询计划。在编译新查询计划时,这可能会导致非常小的延迟,但可以忽略不计:
sp_recompile
exec sp_recompile N'<your procedure>'