Code Library
Home Submit Free Hosting Link To Us Contacts

SQL Reuse of plans with sp_executesql

SQL Reuse of plans with sp_executesql SQL SQL Reuse of plans with sp_executesql Download (.zip)



USE Northwind
GO
DBCC FREEPROCCACHE
GO
EXEC sp_executesql N'SELECT firstname, lastname, title FROM employees 
 WHERE employeeID = @p', N'@p tinyint', 6 
EXEC sp_executesql N'SELECT firstname, lastname, title FROM employees 
 WHERE employeeID = @p', N'@p tinyint', 2
EXEC sp_executesql N'SELECT firstname, lastname, title FROM employees 
 WHERE employeeID = @p', N'@p tinyint', 6
GO
SELECT * FROM master..syscacheobjects
WHERE dbid = 6






Tatet