async_tsql
async_tsql copied to clipboard
Breaks upon a simple date conversion
I tried using this code for one of ETL processes in my databases. And it got stuck right away. As I investigated this I found one strange thing. All stored procedures that don't do date conversion work quite fine. Once you try to convert dates it gets messed up. Try this sp for example:
create or alter procedure [usp_MyDateFubar] as begin SELECT 1 WHERE CAST('01.01.2020' as date) < CAST('31.12.2020' as date) end go
This is a simple and valid SQL statement that executes just fine on my system. If you execute that via usp_AsyncExecInvoke it gets stuck and the service won't work until reset or deleted completely. If you switch that date to '12.31.2020' (which is this strange US notation) it works again. This also happens if you don't use date conversion from strings but also other dates in the WHERE-clause in an non-US format.