Son Vu
Son Vu

Reputation: 89

Concat single Quote(') with String in SQL Server

At mssql I want concat ' and 1 string

Example: Concat ('My name',''')

Ouput : My name'

Upvotes: 2

Views: 32428

Answers (2)

Daniel Marcus
Daniel Marcus

Reputation: 2686

Or you can use '+':

select 'My Name'+''''

Upvotes: 9

DineshDB
DineshDB

Reputation: 6193

Double-up the single quote character

Try this:

SELECT CONCAT('My name','''')

Ouput:

My name'

Upvotes: 10

Related Questions