Quick and dirty way to find the size of all tables in a azure database. DROP TABLE #list DROP TABLE #data GO CREATE TABLE #data ( name VARCHAR(100) […]
Cannot use row granularity hint on the table
Got approached with the below error message recently and thought it might be an interesting problem to look into. ProgrammingError((\’42000\’, 651, \'[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot use […]
#sqlhelp | should you remove indexes from tables before ETL?
Starting today we are introducing a new type of blog content which covers questions from #sqlhelp. We pick random questions from the feed and try to cover them […]
Graph database Script- SQL 2017
Script for the video published here. CREATE TABLE Persons ( PersonId INT identity(1, 1) PRIMARY KEY ,PersonName VARCHAR(100) ) AS NODE INSERT INTO Persons SELECT ‘Batman’ UNION SELECT […]
How Random is the RAND() function? SQL, Chance and the universe.
I use the Random function quite a bit to generate dummy data. So recently I was interested to find out actually how random it is. Randomness implies that […]
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 […]
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 […]
Forcing Columnstore batch mode on Select * type query
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 […]
Weird ways I explain seemingly complicated SQL topics
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 […]
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 […]