Monthly Archives: July 2017

Decimal datatype rounding

By | July 17, 2017

Recently I was asked this question about how decimal is rounding off values when doing a simple calculation. The question was [codesyntax lang=”tsql”] DECLARE @x DECIMAL(38,0)=0 DECLARE @y DECIMAL(32,4)=4.2 SELECT @x-@y –Output -4.2 DECLARE @x DECIMAL(37,0)=0 DECLARE @y DECIMAL(32,4)=4.2 SELECT @x-@y [/codesyntax] I am not able to find why output is getting round off in… Read More »

Identity value skips after restart

By | July 13, 2017

Recently a client of mine had complained to me about an issue they were facing when restarts happen on a system. After a restart the system skips the identity value by a 10 – 1000 depending on the data type of the identity column. This was a known issue in SQL 2012 and was touted… Read More »

Forcing Columnstore batch mode on Select * type query

By | July 7, 2017

Recently at a consulting project while working with tabular model I was asked about how we can force SQL Server to use batch mode on Columnstore index when doing a query which is essentially just a select *. To demonstrate this I have written two queries below which will return the same number of rows… Read More »

Weird ways I explain seemingly complicated SQL topics

By | July 6, 2017

Over the years I have accumulated some seemingly weird ways to explain topics within SQL Server. Usually in a training I find that participants are able to relate to an example in real life compared to some code written on the screen. While often the example might not be a perfect fit it still conveys… Read More »

Rebuild all indexes and statistics on Azure SQL database

By | July 6, 2017

Since Azure SQL databases are limited in what they expose to the management studio client we miss out on a lot of features within SSMS that we could normally use. One of the most common features we use frequently in this regard is the Rebuild Indexes and update statistics features within Maintenance Wizard. Below is… Read More »

BootMgr missing – 3 days of Hell

By | July 5, 2017

Just came out of a real deep mess after my laptop crashed 3 days back. The issue was a fairly common one but none of the solutions found on the internet were working and I had to fix things with extreme prejudice. All my data for the last 5 years exits on the same laptop.… Read More »