Run your first SQL statement
Create a project, add a database and run a statement in the Scratchpad.
In short
SQL Tester runs a stored procedure, function, view or plain SQL against a database your team owns and shows everything that came back. Save a run as a test and your team can re-run it and see when its result changes. Every run rolls back by default, and Production is always read-only.
Before you start
- Who: In an organization you need "Use SQL Tester" (a Member holds it, a Viewer does not). Inside a project your level decides the rest. View reads. Run runs saved tests. Edit changes tests and runs any statement in the Scratchpad. Manage connects databases and shares the project.
- Plan: SQL Tester is part of every plan, Free included. Your plan sets your runs, projects and environments (Plan & usage shows them). Production execution and load testing are on the paid plans.
- First: a database your team owns and a login with the fewest rights the tests need. You can also start with no database (see /help/sql-tester/try-it-not-saved).
Run your first statement
- Open SQL Tester, press "New project" in the Projects rail, name it (for example Billing DB) and press "Create".
- The new project asks you to connect it: "Connect Billing DB to a database". Choose the Provider, paste the "Connection string" and press "Connect". "More options" names the environment and sets its Tier. To add more databases later, see Add an environment.
- Open the "Scratchpad" tab and choose the environment.
- Type the SQL. Its kind follows from what you type: one statement runs as a Query, several as a Script.
- The line under "Run" says the kind and the transaction, such as "Query. Rolled back after each run". Open it to choose another "Kind" - "Stored procedure", "Scalar function", "Table function" and "View" name an object under "Object name", such as dbo.GetInvoice, and a procedure or function takes parameters - or another "Transaction".
- Leave it on "Rolled back after each run" and press "Run". The result appears under it, and the run joins "Your recent runs".
The quick way Before you have a project, SQL Tester shows a Connect card. It creates the project and environment, then runs SELECT 1 AS answer so a first result is on screen before you type anything.
Find your way around
The Projects rail on the left holds your projects. When a project has environments, the header shows an environment picker with a colored tier dot: the Tests board and the Scratchpad run against it.
Share a project
- Open the project and press "Share" in its header, or press the Visible to line under its name.
- Under "Who can open it", choose Private, Team, Team and below, Everyone or Read-only for others, and the team it is filed under.
- Add a person, a team or a role at a level, with "Access until" if the share should end. Changes apply at once.
Good to know
- A project is personal (only you) or belongs to the organization you were working in. A project in your Personal Workspace is never shared.
- A new organization project filed under a team starts open to that team; filed under no team it starts private, because it holds a database credential. The create dialog says which.
- Environments are the managers' to change. Nobody is ever shown a connection string or a secret.
- "People who can run may also run against production" is off for a new project. Until a manager turns it on, only people who can change the project run its tests against Production.
- Your role is the ceiling: without Use SQL Tester you reach no project.
- Your recent Scratchpad runs are listed under the editor, private to you and kept 30 days.
- Every test in a Run all tests counts as a run. Your plan sets your runs, projects and environments; whatever the plan, one person can start at most 30 runs, connection tests and catalog syncs a minute.
- Where you may not add the sample to a shared workspace, the first screen leads with "Try it (not saved)": a practice copy of the sample database just for you. See /help/sql-tester/try-it-not-saved.
- What happens next: the project belongs to the workspace you are in. Nobody is shown a connection string or a secret. Delete the project from its header if you manage it.
If something goes wrong
- "Add an environment to this project before running it.": add or enable an environment.
- "A team project has to be created in an organization workspace.": switch to the organization first.
- A usage limit message: you reached your plan's runs or 30 runs a minute. Wait, or ask an organization admin about the plan.
Related
- /help/sql-tester/connections-and-environments
- /help/sql-tester/try-it-not-saved
- /help/sql-tester/reading-a-result
- /help/sql-tester/saving-cases
- /help/sql-tester/safety-tiers-and-load-testing