Released - TinySQL v2.0 Code Generator
I just released TinySQL code generator v2.0 with few bug fixes and a
new feature of using separator tag for loop statement. You can now use {sap}{/sap} tags to place your separators inside loop.
Here is the example of using {sap}{/sap} tags in TinySQL template:
** Generate Data Provider: Update/v2.0
CREATE PROCEDURE [dbo].[usp_Update$table]{loop}
@$field = $sp_type{sap},{/sap}{/loop}
AS
BEGIN
UPDATE dbo.$table WITH (ROWLOCK)
SET {loop}$field = @$field{sap},{/sap}
{/loop}
WHERE --TODO
RETURN -1
END
And generated code from above template will be like:
CREATE PROCEDURE [dbo].[usp_UpdateAction]
@Id = NUMERIC,
@Action = VARCHAR(250),
@ProjectId = NUMERIC,
@IsNextAction = BIT,
@IsWaitingFor = BIT,
@WaitingForNotes = VARCHAR(1000),
@RemindOn = DATETIME,
@IsDefer = BIT,
@DeferDate = DATETIME,
@IsDone = BIT,
@Sequence = INT
AS
BEGIN
UPDATE dbo.Action WITH (ROWLOCK)
SET Id = @Id,
Action = @Action,
ProjectId = @ProjectId,
IsNextAction = @IsNextAction,
IsWaitingFor = @IsWaitingFor,
WaitingForNotes = @WaitingForNotes,
RemindOn = @RemindOn,
IsDefer = @IsDefer,
DeferDate = @DeferDate,
IsDone = @IsDone,
Sequence = @Sequence
WHERE --TODO
RETURN -1
END
Download: TinySQL v2.0
You can also read my previous blog to learn more about TinySQL tool.
TinySQL Code Generator
Hope you will find this tool useful.