I recently noticed that my local development copy of SQL Server Manager Studio (SSMS, v12.0.5659.1) would sometime run very slowly and other times seemed just fine. This was typically when writing code. For example, running a query or attempting to modify an existing stored procedure would take up to a minute or more to appear. I searched and found others with similar issues but none of the resolutions worked for me. Then by chance I noticed that my Visual Studio 2019 (v16.67.6) was actively running a local web application project. As soon as I stopped that, SSMS would immediately return … [Read more...]
SQL Server – Age Calculations – Day vs Hour
If you need to calculate age in days using SQL Server Transact-SQL, you have lots of options. When your age should be displayed in elapsed "days" for example, you might think that using the DAY attribute in DATEDIFF() would be the way to go. But you may want to use HOUR rather than DAY if your calculations must be accurate. Why? Because with DATEDIFF() using DAY, calculations are based on midnight boundaries. This means that your number of days will change if you are before or after the midnight boundary. For example, your actual time-span may have only been a couple of hours … [Read more...]