Imato.CLR.ParallelRunner
1.0.1
dotnet add package Imato.CLR.ParallelRunner --version 1.0.1
NuGet\Install-Package Imato.CLR.ParallelRunner -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Imato.CLR.ParallelRunner" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Imato.CLR.ParallelRunner --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Imato.CLR.ParallelRunner, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Imato.CLR.ParallelRunner as a Cake Addin #addin nuget:?package=Imato.CLR.ParallelRunner&version=1.0.1 // Install Imato.CLR.ParallelRunner as a Cake Tool #tool nuget:?package=Imato.CLR.ParallelRunner&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MS-SQL CLR - Imato.CLR.ParallelRunner
Helpers for start same procedures in parallel
How to use
- Compile Imato.CLR.ParallelRunner or dounload
- Register new assembly [Imato.CLR.ParallelRunner] in DB
CREATE ASSEMBLY [Imato.CLR.ParallelRunner]
FROM 'PathToDll\Imato.CLR.ParallelRunner.dll'
WITH PERMISSION_SET = UNSAFE;
go
- Create type SqlProcedure
CREATE TYPE dbo.SqlProcedure AS TABLE
(Id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
SqlText NVARCHAR(MAX) NOT NULL,
IsSuccess BIT,
ErrorText NVARCHAR(MAX))
- Create function GetSqlProcedures
CREATE FUNCTION dbo.GetSqlProcedures
(@tableProcedures dbo.SqlProcedure READONLY)
RETURNS NVARCHAR(MAX)
AS
/*
Need to prepare XML parameter @sqlProcedure in procedure dbo.RunParallel
*/
BEGIN
RETURN (
CAST((SELECT t.Id, t.SqlText
FROM @tableProcedures t
FOR XML PATH('Procedure'), ROOT('Root')) AS NVARCHAR(MAX)));
END
- Create procedure RunParallel
CREATE PROCEDURE dbo.RunParallel
@sqlProcedures NVARCHAR(MAX), -- List of procedures
@noOutput BIT = 0, -- don't return result of execution,
@maxThreads INT = 10
AS EXTERNAL NAME [Imato.CLR.ParallelRunner].[RunParallelProcedure].[RunParallel];
- Use it for start others procedures in parallel
Example
-- 1. Create list
DECLARE @commands dbo.SqlProcedure;
insert into @commands
(SqlText)
values
('print ''Test 1''; waitfor delay ''00:00:02'';'),
('waitfor delay ''00:00:02'';');
-- 2. Get parameter @sqlProcedures
DECLARE @sqlProcedures nvarchar(max);
set @sqlProcedures = dbo.GetSqlProcedures(@commands);
-- 3. Execute
EXEC dbo.RunParallel @sqlProcedures = @sqlProcedures
-- @noOutput = 0,
-- @maxThreads = 10
;
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- Imato.CLR.Logger (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.