Discoverable Procedures
Discoverable procedures in the MSSQL (BDK) Book.
Table Discovery
You must first discover a table to generate CRUD automation procedures for it:
discover "table/TableName" from mssqlList: Retrieve multiple rows with optional filtering
Create: Insert a single row
Bulk Insert: Insert multiple rows from a table/array
Get: Retrieve a single row by primary key
Update: Update a single row by primary key
Bulk Update: Update multiple rows from a table/array
Delete: Delete a single row by primary key
How Table Names are Processed
When you discover a table, the book "transforms" the table name to generate user-friendly procedures.
1. Sanitization
Table names are converted to PascalCase. For example:
user_properties→UserPropertiesdbo.sp_GetUsers→DboSpGetUserstable_name→TableNamehasShip→HasShip
2. Singularization
For certain operations, the system creates singular forms of table names:
Users→UserUserProperties→UserPropertyCars→Car
Basic CRUD Operations
1. Retrieve Items (List)
Get all items from a table:
Get items with filtering:
Get items with limit:
2. Create Single Item
First, create a JSON object with the data:
3. Bulk Insert
Insert multiple rows from an external data source (like Excel):
Note: content should be a table structure with multiple rows.
4. Get Single Item by Primary Key
5. Update Single Item
6. Bulk Update
Update multiple rows from an external data source:
Note: content should include the primary key columns for matching existing rows and should be a table structure.
7. Delete Single Item
Advanced Filtering
The book supports various filtering operations:
Stored Procedure Operations
A stored procedure is a pre-written set of SQL commands that's stored in the database server and can be executed as a single unit. Think of it as a function that lives in your database instead of your application code.
Discovery
Discover a stored procedure to make it available for execution:
Or for procedures in the default schema:
Execution
Execute a discovered stored procedure:
Notes:
Parameter names are case-insensitive
Empty string values are converted to NULL
The procedure name in execution uses the sanitized English name generated during discovery
Last updated
Was this helpful?
