At one point in my career I inherited a database that had suffered from neglect (to be kind). The logfiles had be set to autogrow 1MB at a time, and this had happened ALOT! Interestingly this rather small database was taking a surprisingly long time to restore, Knowing that a high number (>1000) of VLFs … Continue reading Virtual logfile (VLF) hell…
Not long ago I took over a database that uses Transactional Replication. Not long after I needed to add an index. So here is the syntax and misc I found for doing this: The important point is that you use ONLINE=ON, and since our TEMPDB is on SSD, go ahead and use SORT_IN_TEMPDB.
I often copy paste the output of "sp_helptext" for some of our stored procedures. For whatever reason, they often paste with numerous blank lines between each meaningful section of code. Here is how I get rid of those lines:
If you need to know the size of all your tables, here's a simple query to get you where you need to go: