SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software Kodyaz SQL Server and T-SQL Development Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




download SQL Server 2016
download SQL Server 2014
download SQL Server 2012



SQL Query Performance Optimization using SET Statistics in SQL Server



SQL query performance optimization in SQL Server is a vital task for SQL developers and SQL Server database administrators. Especially if the database application is showing poor performance, for sql performance optimization database professionals should use helping tools to identify poor code, bottlenecks and missconfigured objects in the SQL database.

Configuring database statistics using "SET STATISTICS" is one of the easiest methods and database tools for developers trying to seek what is causing slow performance of a T-SQL code. Either a t-sql script, or a SQL Server object like an SQL view or SQL Server stored procedure the following script will give starting tips for sql query performance optimization task.



Enalbe time, I/O and profile statistics using the following Set Statistics commands.
Then execute the target sql script or sql procedure which you want to optimize.
Then revert back the configuration settings back to original values.

set statistics time on
go
set statistics io on
go
set statistics profile on
go

--- Execute SQL Query or SQL Stored Procedure
EXEC sp_SQLQueryOptimizationSample
go

set statistics time off
go
set statistics io off
go
set statistics profile off
go

Here is one of the simplest sql query performance optimization tricks that SQL Server developers can use during their daily t-sql tasks.







Related SQL Resources

SQL Server Articles

SQL Server 2012

SQL Server Tools

SQL Blog

SQL Server 2008 Blog

Certification Exams Blog

Reporting Services Blog

Analysis Services Blog

MS SQL Server Forums







Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems