When working with dates/times it can sometimes get a bit confusing when abbreviation options are introduced e.g. abbreviations may pad 0’s,use 24hr (HH) vs 12hr (hh) etc.
This post is simply a confirmation that abbreviations in datediff and datepart do return the same value.
DECLARE @starts datetime = '2017-06-12 19:00:05'
, @ends datetime = '2017-06-12 19:00:07';
SELECT DATEDIFF(ss,@starts,@ends) AS diff_ss
, DATEDIFF(s,@starts,@ends) AS diff_s
, DATEPART(ss,@starts) AS part_ss
, DATEPART(s,@starts) AS part_s;
If for some reason you need to restore the system databases, you’ll typically find copies of the original system databases in the
Below shows the file on a SQL Server 2016 default instance installation:
Details on how to make use of them is found here
shutdown /i command has come in handy many a time and especially when you find that a server just doesn’t appear to be restarting and you’re unable to connect to it.
So if you find yourself in that situation, give this a try and see if it help to resolve the issue.
In case you missed it, AUTOGROW_ALL_FILES was added in SQL Server 2016 and tempdb has this enabled by default.
Further info is mentioned here.
EXEC sp_MSforeachdb '
DB_NAME() AS database_name
,CASE WHEN is_autogrow_all_files = 0 THEN ''no'' ELSE ''yes''
END AS is_autogrow_all_files
What this means is that you should be extra careful that you don’t run out of disk space when suddenly all files need to grow.