Loading ...

How To Clean Plan Query Cache

Hello everybody, some sql notes: dbcc freeproccache; this one will clean plan of cached of sql.   Another note of how to find Sql code and plan by id from dm_exec_cached_plans create function SqlAndPlan(@handle varbinary(max)) returns table as return select sql.text, cp.usecounts,cp.cac...

Sql Formatting Tool

Few days ago I faced following challenge. SQL profiler gave me ugly SQL, which was unreadable for my eyes. For example like this: exec sp_executesql N'SELECT APAddress.AddressID, APAddress.VendorID, APAddress.VendorAddressID, APAddress.IsDefaultAddress, APAddress.RevisionID, APAddress.AddressLine...