To add a little bit, that check will find any reason that a query is forced to run single threaded:
WITH XMLNAMESPACES('http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS p)
SET is_forced_serial = 1
FROM #query_plan qp
WHERE qp.SqlHandle = ##BlitzCacheProcs.SqlHandle
AND SPID = @@SPID
SQL Server data types & functions can be tricky.
Let's start with the ISDATE() function. The docs describe the function fairly concisely:
Returns 1 if the expression is a valid date, time, or datetime value; otherwise, 0.
Even though the function is ISDATE(), it might be better called ISDATEORTIMEORDATETIME(). I guess the latter name just didn't make ...
Yes, this would cause that problem.
if nothing stands against it (other services, vms etc) use as values the number of cpus and with hyperthreading the number of all virtual cpus.
For more information and recommendation you can see at
This is the essence of what it means to be a system_versioning temporal table. You cannot control the row start and row end values. If you want the rows to be deleted after 5 days, you'll have to have a job to delete them.
Echoing other comments from replies and answers I'd advise against opening up a SQL Server directly to the internet. Setting up a VPN on your network that the other person can connect to is the preferred solution.
The steps to prepare SQL Server for a remote connection via VPN or directly are mostly the same so here's how to get your server ready:
Thanks to David Browne,
I used procmon and could find the settings are stored in the below regedit section,
Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\SQL Server Management Studio\18.0_IsoShell\General
Change these values to 1-24
ISDATE() can be a tricky function, and you probably are better off using the explicit TRY_CONVERT() function for testing if a value is properly formatted as a date.
My guess is that example value you specified is being treated as a date with time which is why ISDATE() returns true, similar to the issue in this post.
You could try along:
Occupancy as (
case when r.RoomId < p.Guests - p.Rooms + 1 then 2 else 1 end as GuestsInRoom,
case when r.RoomId < p.Guests - p.Rooms + 1 then 2 when r.RoomId > p.Guests then 0 else 1 end as GuestsInRoomWithSparesAndMissing
from Package p
Based on the execution plans you provided, it appears that your table doesn't have a clustered index of any sorts, as noticeable by the RID Lookup operation. As a result, for the SELECT query, my guess is the SQL Engine is thinking using any available index to scan in conjunction with a RID Lookup would be the most performant operation for locating the data.
Monitor Transaction Log shipping using T-SQL and SSMS by Jignesh Raiyani
View the Log Shipping Report (SQL Server Management Studio)
Using TSQL get details of last restored transaction log Backup (Subscriber Side):
SELECT b.type, b.first_lsn, b.last_lsn, b....