Decimal datatype rounding

Recently I was asked this question about how decimal is rounding off values when doing a simple calculation. The question was 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…

Identity value skips after restart

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…

Rebuild all indexes and statistics on Azure SQL database

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…