rusanu / async_tsql Goto Github PK
View Code? Open in Web Editor NEWAsynchronous T-SQL procedure execution
License: Apache License 2.0
Asynchronous T-SQL procedure execution
License: Apache License 2.0
Thank you so much for sharing this code!
If you wouldn't mind editing https://github.com/rusanu/async_tsql/blob/master/README.md and adding a note along these lines, it'd probably help other newbies like me:
To actually get your SPROCS to be called, you need to SET ENABLE_BROKER on the database, e.g.:
ALTER DATABASE [Database_name] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
Here's where I shared this tip on StackOverflow: http://stackoverflow.com/a/31861317/908677
Thanks again!
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.
The implementation of procedure [usp_AsyncExecInvoke] appears to have a 'copy/paste' type error. At the bottom of the proc, in the error processing section is the line:
rollback transaction usp_my_procedure_name;
I suspect this should read:
rollback transaction usp_AsyncExecInvoke;
and is the result of copying some code from a prior blog example on error processing. Of course, I could be wrong.. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.