Prepara texto para insertarlo de forma segura en una consulta SQL.
Cargando la herramienta...
Cómo usar Escapar SQL
Pega el texto.
Elige el dialecto.
Copia el resultado.
Sobre Escapar SQL
Diferentes motores de base de datos usan convenciones distintas para escapar comillas. Esta herramienta ofrece el estilo estándar y el de MySQL (barra invertida).
What gets escaped
Standard SQL: a single quote becomes two single quotes. MySQL style: backslash, single and double quotes, NUL, line breaks and Ctrl+Z get a backslash.
Preguntas frecuentes
Is escaping enough to stop SQL injection?
No. Use prepared statements with bound parameters. Manual escaping is easy to get wrong, especially with character sets and different SQL modes.
Which dialect should I choose?
Standard doubling works in PostgreSQL, SQL Server, SQLite and Oracle, and in MySQL unless NO_BACKSLASH_ESCAPES is set. The MySQL style is for text that will be run in MySQL, where backslashes are escape characters.
Why does PostgreSQL ignore my backslashes?
By default PostgreSQL treats backslashes in normal strings as plain characters. Use the standard style, or an E'...' string if you want backslash escapes.
What about LIKE patterns?
Percent and underscore are wildcards in LIKE and need their own escape character, which this tool does not add.