Building a SQL Restore Script When Your Backup Runs
It is handy to have a SQL Restore script ready to go for every backup that you run. Here is a script that will help with that.
It is handy to have a SQL Restore script ready to go for every backup that you run. Here is a script that will help with that.
SQL Server 2017 introduces a new column in the sys.dm_db_file_space_usage system table. The column is modified_extent_page_count, which tells how many pages have been modified in your data file since the last full backup. What is really interesting about this is that with …
Determining how much of your data file has been modified Read more »
From time to time I get asked about checkDB, and there are many solutions out there, but I have one that I generally use that is very simple and does the job. The script below created a stored procedure in …
Yes, you can create temporary stored procedures by prefixing the name of the sproc with a #. The temporary stored procedure is sort of a “leave no trace” stored procedure that is only good for your session. If you use …
The question of how to delete a trigger after a specific date came up. Here is what could be done. If you want to trigger to disappear after a specific date or time, you can just drop the trigger …
Updating SQL Server statistics may not be as obvious as it may sound. Imagine this scenario. I invite you over for dinner and a game of Scrabble. After dinner, I start to do the dishes, while you set up the …
The Optimize for Ad Hoc Workloads server configuration can improve performance, and is extremely unlikely to negatively impact performance. This was a new feature that was introduced in SQL Server 2008, and as with many new features in SQL Server, …
The alternate solution to the Database Corruption Challenge this week was created by Patrick Flynn. This solution is the only solution to successfully recover all the data without using any of the backups. If the challenge had been structured differently …
Database Corruption Challenge Week 7 – Alternate Solution Read more »
How do you check if a database exists, drop it and recreate it for testing purposes? After running the Database Corruption Challenge for several weeks now, I have seen many scripts to drop and recreate a database. This makes it …
It is my pleasure to announce the winners in the Week 4 Database Corruption Challenge. But first how about a rundown of challenge. In order to make up for the difficult time that Challenge #3 was issued, Challenge #4 was …