DB Studio — Verify with SQL · Data Tabs
Before writing any script code, we recommend verifying the connection and data directly in DB Studio's two tabs. Run the same SQL twice, confirm the same result, then move it into a script.
Solution Explorer
└── Data Editor Pages
└── Database
├── Database Connections (Ch. 2)
├── Database Studio ← this chapter
│ ├── Structure tab (table / column tree from Ch. 3)
│ ├── SQL tab (free SQL execution)
│ └── Data tab (row-level view / edit)
└── Database Events (Ch. 8)Pick the local connection in the left tree, then switch tabs.
SQL Tab — Free Execution
Type SQL in the top input and press [Run] or Ctrl + Enter.
SQL worth trying often against the sample project:
-- Total row count
SELECT COUNT(*) FROM order_history;
-- Last 5 jobs
SELECT id, order_no, menu_name, result, end_time
FROM order_history
ORDER BY id DESC
LIMIT 5;
-- Counts per result
SELECT result, COUNT(*) AS cnt
FROM order_history
GROUP BY result;
-- Errors only
SELECT id, order_no, menu_name, weight_g
FROM order_history
WHERE is_error = 1;The script-side RunSqlSelect / RunSqlScalarInt accept exactly the same SQL strings. Get the habit of only moving SQL that already works in this tab into scripts and your debugging time drops sharply.
Result area
| Area | Content |
|---|---|
| Result grid | SELECT result rows — column names, values, sorting |
| Message / row count | Affected Rows: N (on INSERT / UPDATE / DELETE) |
| Execution time | Sanity-check responsiveness of simple SQL |
Data Tab — Row-Level View / Edit
Picking a table in the left tree shows all of its rows as a grid. You can edit cells directly to UPDATE on the spot.
Recommended uses:
- Tweak one or two test rows quickly
- Verify with your own eyes that script results (after, e.g.,
DB_UpdateSelected) actually landed in the DB - Pre-fill an empty table to check ViewRun's display
Warning — Direct edits on a production DB through the Data tab leave no change history. In production, modify via scripts (transaction + log) wherever possible.
Recommended Verification Order
- Connections — confirm
localis registered (Ch. 2) - Structure tab — confirm
order_historyexists (Ch. 3) - SQL tab — run the 4 queries above and check results
- Data tab — edit a row or two → verify with SELECT from SQL tab
- If empty, run the following in SQL tab to seed one row:
INSERT INTO order_history(order_no, menu_name, start_time, end_time, weight_g, result, is_error)
VALUES('O0001', 'Americano', '2026-01-01 09:00:00', '2026-01-01 09:00:30', 250, 'Done', 0);Once these 5 steps pass, scripts are next.