Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Friday, May 12, 2017

SSRS Reports Deployment Tool



This tool  deploys SSRS reports and related SQL scripts in one go without using SSRS Reports Manager or SQL Management Studio.

Listed below are the features in brief.

  • Search for RDL and SQL files (including any image files) in the base directory and sub-directories and includes them in the list to be deployed.
  • View/delete files from the list in the UI
  • Drag/Drop files/folder from anywhere to add to the list of files to be deployed.
  • Live log report that tells what's going on.
  • Re-deploy only failed scripts/files.

Source Code available on GitHub

Sunday, October 7, 2012

Does use of Stored Procedures increase performance?


“Stored procedures are precompiled and cached so the performance is much better.”
Three things happen when a SQL command is executed:
  • The SQL syntax is checked for any errors.
  • The best plan is selected to execute the SQL (choice to use clustered index, non-clustered etc.).
  • Finally the SQL is executed.
When a stored procedure for the first time it will go through all the above steps and the plan will be cached in-memory. So the next time when the stored procedure is executed it just takes the plan from the cache and executes the same. This increases performance as the first two steps are completely eliminated.
It implies that for inline queries all the above steps are repeated again and again which brings down the performance considerably.

The above explanation was pretty valid and true for older versions of SQL Server, but from 2005 onwards, all SQL statements, irrespective of it’s a SQL coming from inline code or stored procedure or from anywhere else, they are compiled and cached.

Detailed blog from CodeProject.com at http://bit.ly/PhofYm 

Sunday, September 25, 2011

SELECT COUNT(*) vs COUNT(1) vs COUNT(ColumnName)

COUNT(*) – Number of records in the table regardless of NULL values and duplicates
COUNT(1) – Number of records in the table regardless of NULL values and duplicates **IMPORTANT NOTE: The 1 does NOT refer to an ordinal location of a column. This will not count the records in the first column of the table as COUNT(ColumnName) does.**
COUNT(ColumnName) or COUNT(ALL ColumnName) – Number of non-NULL values
COUNT(DISTINCT ColumnName) – Number of distinct non-NULL values