Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create function foo (@a int)
- returns int
- as
- begin
- return @a
- end
- -- clear out the plan cache
- dbcc freeproccache
- dbcc dropcleanbuffers
- go
- -- use the function
- select dbo.foo(5)
- go
- -- inspect the plan cache
- select * from sys.dm_exec_cached_plans
- go
- select * from sys.dm_exec_query_plan(<insertplanhandlehere>)
- CREATE FUNC dbo.Foo ()
- RETURNS TABLE
- AS
- RETURN (SELECT ...)
- GO
Add Comment
Please, Sign In to add comment