Здравствуйте, IB, Вы писали:
IB>Не везде, есть пара статей в MSDN-е, где написано как все происходит на самом деле. IB>Ссылок не дам, лень искать.
Поискал сам, похоже Вы правы. То, о чем я говорил относилось еще к mssql 6.5. На всякий случай, что бы поставить точку, процитирую MSDN (KB243586):
[msdn]In SQL Server 7.0, a new behavior is introduced that may cause a stored procedure to recompile during execution. This new behavior ensures that the optimizer always has the best possible plan for each specific statement within a procedure. The following events may cause a run-time recompilation of a stored procedure:
A sufficient percentage of data changes in a table that is referenced by the stored procedure.
The procedure interleaves Data Definition Language (DDL) and Data Manipulation Language (DML) operations.
The procedure performs certain operations on temporary tables.[/msdn]