Load balancing reads SQL Server 2016 AG

April 19, 2017 Andy 0

Question I’m trying to balance read traffic between two SQL Server 2016 Enterprise Edition instances (Primary and Secondary) using availability groups and the read only routing. Here is my current setup: The servers are in AWS in two different AZ The servers are in a … [Read More]

Preventing SQL injection in dynamic SQL

April 14, 2017 Andy 0

Question Let’s imagine a stored procedure that retreives data and do some kind of pagination. This procedure has some inputs describing which set of data we want and how we sort it. Here is a very simple query, but let’s take it as an example. … [Read More]

Releasing free space in mdf file to OS

April 10, 2017 Andy 0

Question We have a 120GB database. There was table with 60GB of data which is useless and we have truncated it. Now database size is 120GB with free space 60GB. The database will not grow up to 60GB in at least 3 months. So can … [Read More]

Transaction log growth during BACKUP

April 10, 2017 Andy 1

Over on Stack Exchange, someone asked why their transaction log was growing very fast during a full backup. An interesting tidbit to this question is that the database is in SIMPLE recovery — so the log should stay tiny, right? Wrong. While taking a full backup of … [Read More]

Transaction log is growing very fast

April 5, 2017 Andy 0

Question One of our SQL Server 2014 database transaction logs is growing very fast and I cannot find the root cause for this. Database in Simple recovery mode. During full backup the log file grows to its limits (800GB) and backup fails. I checked the … [Read More]