Recent Posts

  • SQL Server Fullscan Statistics Being Overwritten with Sample Statistics

    SQL Server Fullscan Statistics Being Overwritten with Sample Statistics

    I observed this behavior only in following version of SQL Server while using Always On Availability Group feature.

    Version: Microsoft SQL Server 2012 (SP3) (KB3072779) – 11.0.6020.0 (X64) Oct 20 2015 15:36:27 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 (Build 9600: )

    In this article by David Barbarin similar behavior was also observed in SQL Server 2014 SP2.

    Once I update my statistics with fullscan, with in 10~20 seconds some of the statistics on the same table are getting update on secondary with a sample pecent of rows. Meaning my best statistics are being …



  • TSQL Tuesday #79 -JSON Support in SQL 2016

    TSQL Tuesday #79 -JSON Support in SQL 2016

    I thank Michael J Swart (b|t) for hosting TSQL Tuesday #79. Topic for this month is to write about SQL Server 2016. This is my first time joining in TSQL Tuesday and I am excited about it.

    TSQL2SDAY-300x300

    In my workplace we use MongoDB besides SQL Server. MongoDB save documents in binary form of  JSON called BSON. Our developers are excited to see JSON support in SQL 2o16.  I will give some simple examples about JSON support in SQL Server 2016.  Readers need to be aware that SQL Server is not supporting native JSON type.  In …


  • Schedule SQL Agent Job With Availability Group

    Schedule SQL Agent Job With Availability Group

    There was a tweet came last night from Lohit about “need guidance on how to enable a set of jobs on secondary AG as soon as failover happen from pri to sec AG”.  I have implemented a solution for most (I am using “most”  literally because I have not done this for all jobs) of the agent jobs so jobs will run always on primary node.  For example, I want to run DBCC CHECKDB, recycle error log on primary and all readable secondaries.  That way for the jobs that I want to run on primary node only  I do not …


  • Allocation Pages In SQL Server

    In order to understand how page/extent allocation works with in SQL Server for entities (objects) I was reading Paul Randal’s (B|T) blog. While reading different articles I thought of summarizing few critical information into a table. Which will help me consuming the information better and review easily when I need to. With Paul’s written consent I am sharing this and hope will help others.

    Allocation Page in SQL Server

    Download Poster