Transaction Replication on AlwaysOn

April 17, 2017 Andy 0

Question In our AlwayOn environment I have two SQL servers 2014 Ent.edition (SERVER A, and SERVER B). I setup a transaction replication for [database A ], pointing to listener which shouldn’t cause any issue if a failover happened. Tested, worked just fine after a failover, … [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]

SQL Triggers not preventing insert

April 10, 2017 Andy 0

Question I am having trouble getting a trigger to work. What it needs to do is to prevent any customer with last name Glass from being inserted into the database. This is what I have: The issue is when I add customers with last name … [Read More]

Converting date stored as a varchar

April 6, 2017 Andy 0

Question I’m creating a query that has a column of dates stored as a VARCHAR in the format DD-MMM-YYYY. Could you tell me how I can convert this into date format please? I don’t want to alter the original table in any way, as it’s … [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]