Query SQL Server in plain English
Connect your database, type the question, get the answer. ByeSQL writes T-SQL against your real schema, runs it read-only, and gives you a table, a chart or a dashboard panel. Nothing is installed on the server.
Generated as T-SQL, not as generic SQL
A model writing "SQL" tends to write the dialect it saw most. The differences are small and they break the query.
LIMIT 10, which is a syntax error here- Quoting and date functions borrowed from another engine
- A row cap that silently does not apply
- Fails loudly at best, returns the wrong rows at worst
SELECT TOP (n)orOFFSET 0 ROWS FETCH NEXT n ROWS ONLY- An
ORDER BYadded when the fetch syntax needs one - The cap enforced whichever form the query already used
- A dialect name passed to the model, so it targets T-SQL from the start
It works from your real schema
The most common failure of a general-purpose model writing SQL is inventing a table or a column. ByeSQL sends your actual schema as context with every prompt, so there is nothing to guess.
Database and schema
SQL Server separates the two, so both are part of the connection and introspection reads the one you point it at.
Tables and views
Both are read, so a question can be answered from a view you already built for reporting.
Keys and relationships
Primary keys, foreign keys and unique indexes, so a generated JOIN follows the relationships that actually exist.
Your schema is cached when you connect. After a migration, hit Refresh on the connection to re-read it.
The connection we recommend
Never connect with sa or your application login. Create a login mapped to a read-only database user.
-- On the server
CREATE LOGIN byesql_reader WITH PASSWORD = 'a-strong-password';
-- In the database you want to expose
USE your_database;
CREATE USER byesql_reader FOR LOGIN byesql_reader;
ALTER ROLE db_datareader ADD MEMBER byesql_reader;db_datareader grants SELECT on every table in the database. To expose only some of them, skip the role and grant SELECT per object instead.
Running Oracle too?
Connect them both and switch between them in the same workspace. Six engines are supported today.
SQL Server questions
SQL Server has no LIMIT. How is the row cap enforced?
With the T-SQL equivalent. If the generated query already starts with SELECT TOP (n) that number is lowered when it exceeds the maximum; otherwise an OFFSET 0 ROWS FETCH NEXT n ROWS ONLY clause is appended, with an ORDER BY added first when the statement has none, because T-SQL requires one for the fetch syntax.
Does it understand schemas, not just the database?
Yes. SQL Server separates the database from the schema inside it, so the connection form asks for both and introspection reads the schema you point it at. Scoping the login is still how you control what is visible.
Which editions and versions work?
ByeSQL connects over standard JDBC, so any supported version works, including Azure SQL Database and SQL Server running on Amazon RDS. Nothing is installed on the server: it connects as an ordinary login.
Can it write to my database?
No. A statement only passes if it begins with SELECT or WITH, and it is rejected if any of nine write keywords appears anywhere in it, before the SQL reaches SQL Server. Pair that with a login mapped to a read-only user and both layers would have to fail for a write to happen.
Ask your SQL Server database a question
Free plan, no credit card. Read-only by default, so production is a safe place to start.