TOP expressions
TOP belongs near SELECT and can use parentheses, percentages, and ties. A formatter may expose its structure but must not replace it with another dialect's LIMIT.
T-SQL profile · Browser-only · No database connection
Beautify Transact-SQL with dialect-aware handling for bracketed identifiers, variables, temporary objects, TOP, CTEs, windows, and offset pagination. Nothing is sent to SQL Server.
SELECT TOP (25)
[OrderID],
[TotalDue]
FROM [Sales].[Orders]
WHERE [Status] = @status
ORDER BY [TotalDue] DESC;
T-SQL-aware layoutFormatting, not execution
Transact-SQL query beautifier
The SQL Server / T-SQL profile loads automatically. Control indentation, keyword case, expression width, logical-operator breaks, and statement spacing before a disposable local worker formats the text.
Loading the T-SQL formatter…
Enable JavaScript to format Transact-SQL locally. SQL Server syntax and review guidance remains readable below.
Keep formatting reversible
Start from version-controlled source or save an untouched copy. Queries can contain sensitive object names and filters even when no row data is present.
Select SQL Server / T-SQL because that is the execution target. The formatter then recognizes SQL Server vocabulary and token conventions instead of trying to translate them.
Review bracket identifiers, variables, hints, comments, strings, batches, and every filter. Then parse and test with the exact SQL Server version, compatibility level, database, and permissions.
T-SQL has its own lexical edges
Transact-SQL extends SQL with variables, procedural control flow, system functions, temporary objects, table and query hints, error handling, batch-oriented tooling, and SQL Server-specific DDL and DML. A generic formatter may recognize the main clauses but misread punctuation or place a vendor extension as though it were an identifier.
Square brackets delimit identifiers such as [Order] or names containing spaces. Double-quoted identifier behavior depends on QUOTED_IDENTIFIER. Variables generally begin with @, temporary object names can begin with #, and global temporary objects with ##. Those characters are not generic decoration and must remain attached to the intended token.
Unicode character strings commonly use an N prefix. SQL Server also supports multipart names and specific conventions for system and user-defined objects. This tool can change recognized keyword case but keeps function, type, identifier, and quoted text spelling unchanged. That is safer for user-defined functions and case-sensitive collations, but it is still necessary to inspect the diff.
@.# or ## have session scope behavior.Do not translate while formatting
TOP belongs near SELECT and can use parentheses, percentages, and ties. A formatter may expose its structure but must not replace it with another dialect's LIMIT.
SQL Server offset pagination follows ORDER BY with row counts and an optional next-page count. Layout cannot prove that the ordering is deterministic.
Hints such as WITH (...) can affect locking, access paths, and consistency. They must stay with the table reference and receive expert review.
OPTION (...) appears at a query boundary. Moving or dropping a hint is a semantic change, not beautification.
Client tooling adds another layer
GO is recognized as a batch separator by tools such as SQL Server Management Studio and sqlcmd. It is not a Transact-SQL statement sent to the database engine like SELECT. A formatter focused on SQL tokens may preserve a familiar GO line without understanding every client rule, repeat count, or surrounding deployment tool.
Stored procedures, functions, triggers, dynamic SQL, TRY/CATCH blocks, cursor operations, and control flow create a broader formatting problem than a single query. Stored procedures and custom-delimiter scripts, including MySQL DELIMITER directives, are not supported here; use SQL Server- and client-aware tooling for routines and deployment scripts.
SQL projects and deployment pipelines may add SQLCMD variables, preprocessor directives, migration annotations, or template syntax. Format with a tool that knows that outer layer, or format a representative rendered artifact. Never delete unfamiliar markers simply because they produce an unattractive formatter result.
Review batch separators in the context of SSMS, sqlcmd, Azure Data Studio, a database project, migration runner, or whichever client will consume the script. Server-side grammar alone is not enough.
Microsoft documentation for GO →No connection string required
The page has no instance, database, login, access token, connection string, catalog, transaction, or query window. It cannot execute the text.
Text goes only to a worker created by the page. It is not submitted to a query service, proxy, telemetry endpoint, or remote formatter.
Input is capped at 50,000 characters, a warning appears at 25,000, the worker stops after 2 seconds, and output beyond 200,000 characters is discarded.
Only your button press copies the result or downloads a local .sql file. Clipboard tools, files, extensions, and device policies remain outside this page.
Pretty T-SQL can still be wrong
Questions answered
No. It formats text locally and has no server, database, credentials, schema, compatibility level, session settings, plan cache, or execution connection.
The T-SQL profile recognizes square-bracket identifiers, at-sign variables, temporary object names, and SQL Server vocabulary. Review every automated rewrite because settings, extensions, client commands, and new syntax can affect tokenization.
No. GO is a batch separator recognized by client tools such as SSMS and sqlcmd, not a Transact-SQL statement sent to the server. Scripts with batches need client-aware review.
No. Validate syntax, objects, types, compatibility level, permissions, row-level behavior, plans, and results with the intended SQL Server environment and application tests.
No. That would be dialect translation and can require semantic decisions. This page formats existing T-SQL; it does not convert MySQL, PostgreSQL, BigQuery, or another dialect into SQL Server syntax.
No. Stored procedures and custom-delimiter scripts, including scripts using MySQL's DELIMITER client directive, are not supported. Use SQL Server- and client-aware tooling for routines and deployment scripts, and keep the original unchanged.
Pathological formatting can consume significant memory. LiveParse terminates its disposable worker to protect the tab. Split scripts only at safe batch or statement boundaries and preserve dependencies and transactional meaning.