custom character for strings on mysql workbench

Mattia Cammalleri 1 Reputation point
2021-09-27T14:15:51.627+00:00

Hi,
i have a string that contains both characters ' and ", i need to use this strings inside an insert.
The problem is that due to those characters the strings results "splitted" therefore invalid.
Can i change the characters ' and " to some other characters?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,737 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Mattia Cammalleri 1 Reputation point
    2021-09-27T15:33:45.137+00:00

    The string that i have to insert contain the 2 characters for string so i the command input is invalid. please check here: ibb.co/34SqNxv and see how i'm trying to insert the string " Contenuto1"' " bu since the string contain those special chaacters the command become invalid.

    0 comments No comments

  2. Viorel 112.2K Reputation points
    2021-09-27T15:54:21.62+00:00

    Try using ' to write the strings and double each ' that appears inside the text. For example:

    • 'a''b' — two ' between a and b denotes a single '.

    The quotation mark (") can be written directly inside such strings.


  3. YufeiShao-msft 7,056 Reputation points
    2021-09-28T08:00:00.883+00:00

    Hi @Mattia Cammalleri ,

    SQL Server is really different from MySQL, I suggest you can go to a MySQL related for advice.

    If you can try to replace the ‘ and “ with other characters in a MySQL column?

    https://stackoverflow.com/questions/7734077/mysql-replace-character-in-columns

    0 comments No comments