Posts

Dealing with Change Data Capture jobs for databases in Availability Groups

Problem Having Change Data Capture enabled on databases that are part of an Availability Group, each time a failover happens (automatically or manually), we have to remember to make sure that the CDC capture and cleanup jobs are created and the capture job is started accordingly on the primary replica. Let's be honest, we are not going to remember (nor we want to) that after doing a system update and doing multiple failovers or after automatic failover we have some manual work to do. If we do forget about it, we most likely going to end up wtih some data loss in our CDC tables and a gap in anything that might rely on that data. Solution Lets first point out few things that we have to keep in mind while dealing with the problem that we are presented: There might be more than one Availability Group in a Always On setup and each group might have primary role on different nodes. When enabling CDC on a database, jobs are only created on the currently active node. This means t...

sp_QueryShortcuts - setup and how to use them

Image
Weather you're a DBA or Developer this set of shortcuts for SQL Server Management Studio will make your life hell of a lot easier. It will take you some time to get used to them but once you do it will be worth it, I can't imagine working without those anymore. Project was inspired years ago when i saw a similar usage of a stored procedure in SSMS query shortcuts. It was used for a specific database and wasn't very flexible, so i decided to pick it up and work on it, improve it and make it more accommodating and user friendly, so that anyone can use it anywhere. I would appreciate some feedback and constructive criticism that would help improving sp_QueryShortcuts. Download Latest version of the script always available  HERE Setup First thing that we have to do is go to our SQL Server Management Studio studio options and assign sp_QueryShortcuts stored procedure to each shortcut. Steps: Go to Tools // Options   Then Environment // Keyboard // Query Shortcut...