-1

I am stuck with the following SQL line due to the apostrophe. I am using this to generate a table in Power BI that is used as the RLS link. As a result the apostrophe needs to stay in one string.

select 'adam.obrian@email.com.au' as Email, 'Adam O'Brian' as Access union all

How would I get around this?

Expecting a table as below:

Email Access
adam.obrian@email.com Adam O'Brian

Ignoring the Union all, this is part of a long table query.

Dodds22
  • 1
  • 1
  • 1
    Does this answer your question? [How do I escape a single quote in SQL Server?](https://stackoverflow.com/questions/1586560/how-do-i-escape-a-single-quote-in-sql-server) – ceejayoz Nov 07 '22 at 02:28

1 Answers1

-1

Pleased to say I got this one sorted myself.

All it needed was a double apostrophe as below:

select 'adam.obrian@email.com.au' as Email, 'Adam O''Brian' as Access union all

Cheers

Dodds22
  • 1
  • 1