Powerful aspects of combining AI assistance with TSQL.APP
Instead of writing everything from scratch, you can:
- Describe what you need ("I need a QR scanner that processes warehouse codes")
- Get a complete TSQL.APP solution from the AI
- Make small tweaks to customize it for your specific needs
For example, if you needed a form for customer data entry, you could just ask me to create the initial code, and I would generate something like:
DECLARE @CustomerName NVARCHAR(100);
DECLARE @Email NVARCHAR(100);
DECLARE @SubmitButton NVARCHAR(100);
DECLARE @Message NVARCHAR(MAX);
EXEC sp_api_modal_get_value @name='@CustomerName', @value=@CustomerName OUT;
EXEC sp_api_modal_get_value @name='@Email', @value=@Email OUT;
EXEC sp_api_modal_get_value @name='@SubmitButton', @value=@SubmitButton OUT;
EXEC sp_api_modal_text @text=N'New Customer', @class='h2';
EXEC sp_api_modal_input @name='@CustomerName', @value=@CustomerName OUT, @placeholder=N'Customer Name';
EXEC sp_api_modal_input @name='@Email', @value=@Email OUT, @placeholder=N'Email Address';
EXEC sp_api_modal_button @name='@SubmitButton', @value=N'Save Customer', @valueout=@SubmitButton OUT;
IF @SubmitButton IS NOT NULL
BEGIN
-- You would just customize this part for your needs
INSERT INTO Customers (Name, Email) VALUES (@CustomerName, @Email);
SET @Message = N'Customer saved successfully!';
EXEC sp_api_toast @text=@Message, @class='btn-success';
EXEC sp_api_modal_clear;
RETURN;
END
Then you just modify the business logic part to match your specific requirements. This approach:
- Saves significant development time
- Reduces chances of syntax errors
- Ensures best practices are followed
- Lets you focus on business logic rather than UI code
Would you like to try this with a specific example? I can help generate the initial code for any TSQL.APP functionality you need.
Yes please
I'm glad you see the value in this approach! It's a powerful combination - having AI generate the TSQL.APP boilerplate code and stored procedure calls, while you focus on customizing the business logic and specific requirements. If you have any specific functionality you'd like to create (like a data entry form, report generator, file uploader, etc.), feel free to describe what you need, and I can help generate the initial TSQL.APP code for you. For example, you could say something like:
- "Create a form for entering customer orders"
- "Make a dashboard showing sales metrics"
- "Create a file upload interface for documents"
- "Build a QR code generator for inventory items"
Just let me know what you'd like to build!
Build a QR code generator for inventory items
I'll create a QR code generator for inventory items that shows both the QR code and allows printing. Here's the code:
This is made by the AI:
-- Declare variables for form handling
DECLARE @ItemCode NVARCHAR(100);
DECLARE @ItemName NVARCHAR(100);
DECLARE @GenerateButton NVARCHAR(100);
DECLARE @PrintButton NVARCHAR(100);
DECLARE @QrValue NVARCHAR(MAX);
DECLARE @Message NVARCHAR(MAX);
-- Sync with modal values
EXEC sp_api_modal_get_value @name='@ItemCode', @value=@ItemCode OUT;
EXEC sp_api_modal_get_value @name='@ItemName', @value=@ItemName OUT;
EXEC sp_api_modal_get_value @name='@GenerateButton', @value=@GenerateButton OUT;
EXEC sp_api_modal_get_value @name='@PrintButton', @value=@PrintButton OUT;
-- Create the form interface
EXEC sp_api_modal_text @text=N'🏷️ Inventory QR Code Generator', @class='h2';
-- Input fields
EXEC sp_api_modal_input
@name='@ItemCode',
@value=@ItemCode OUT,
@placeholder=N'Enter Item Code',
@class='form-control';
EXEC sp_api_modal_input
@name='@ItemName',
@value=@ItemName OUT,
@placeholder=N'Enter Item Description (optional)',
@class='form-control';
-- Generate button
EXEC sp_api_modal_button
@name='@GenerateButton',
@value=N'Generate QR Code',
@valueout=@GenerateButton OUT,
@class='btn-primary';
-- Display QR code if generated
IF @GenerateButton IS NOT NULL AND @ItemCode IS NOT NULL
BEGIN
-- Create QR code value (customize prefix as needed)
SET @QrValue = CONCAT('INV:', @ItemCode);
-- Display item info
SET @Message = CONCAT(N'Item: ', @ItemCode);
IF @ItemName IS NOT NULL
SET @Message = CONCAT(@Message, N' - ', @ItemName);
EXEC sp_api_modal_text @Message, @class='h4';
-- Generate and display QR code
EXEC sp_api_modal_qr_code
@value=@QrValue,
@size=300,
@print=1; -- Enable printing
-- Add print button
EXEC sp_api_modal_button
@name='@PrintButton',
@value=N'🖨️ Print QR Code',
@valueout=@PrintButton OUT,
@class='btn-success';
-- Show value below QR code
EXEC sp_api_modal_text @QrValue, @class='text-muted';
END
-- Add quit button
DECLARE @QuitButton NVARCHAR(100);
EXEC sp_api_modal_get_value @name='@QuitButton', @value=@QuitButton OUT;
EXEC sp_api_modal_button
@name='@QuitButton',
@value=N'Close',
@valueout=@QuitButton OUT,
@class='btn-secondary';
-- Handle quit
IF @QuitButton IS NOT NULL
BEGIN
EXEC sp_api_modal_clear;
RETURN;
END
This code creates an interface that:
- Allows input of an item code and optional description
- Generates a QR code with a prefix "INV:" (you can customize this)
- Shows the generated QR code with the item information
- Enables printing of the QR code
- Displays the encoded value below the QR code
You can customize it by:
- Changing the QR code prefix (currently 'INV:')
- Adding database lookups for item validation
- Modifying the QR code size (currently 300)
- Adding additional fields
- Changing the format of the encoded data
Would you like me to modify any part of this or add additional functionality?