# Re: Uploading data to MS SQL Server - problem with quote cha

**URL:** <https://www.ruby-forum.com/t/re-uploading-data-to-ms-sql-server-problem-with-quote-cha/89668>\
**Category:** Ruby\
**Created:** [January 5, 2006, 2:42am UTC](https://www.ruby-forum.com/t/re-uploading-data-to-ms-sql-server-problem-with-quote-cha/89668 "2006-01-05T02:42:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![warren\_b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/4bbf92/32.png) [@warren\_b](https://www.ruby-forum.com/u/warren_b)\
**Post date:** [January 5, 2006, 2:42am UTC](https://www.ruby-forum.com/t/re-uploading-data-to-ms-sql-server-problem-with-quote-cha/89668/1 "2006-01-05T02:42:42Z")

</div>

Sam,

> I need to upload data coming from Oracle database to  
> an MS SQL Server. But I’m having problems inserting  
> if data contains a quote (’) character.

```
On most all modern databases, a single quote must be quoted with

```

another single quote. For example, to update a value to the string “I  
don’t know”:

UPDATE mytable SET mystring = ‘I don’‘t know.’

```
I hope this helps.

- Warren B.
```

---

<div class="post-metadata">

**Author:** ![warren\_b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/4bbf92/32.png) [@warren\_b](https://www.ruby-forum.com/u/warren_b)\
**Post date:** [January 6, 2006, 7:19am UTC](https://www.ruby-forum.com/t/re-uploading-data-to-ms-sql-server-problem-with-quote-cha/89668/2 "2006-01-06T07:19:30Z")

</div>

On Wednesday 04 January 2006 19:41, Warren B. wrote:

> UPDATE mytable SET mystring = ‘I don’‘t know.’
> 
> ```
> I hope this helps.
> 
> - Warren B.
> 
> ```

You’ll also want to escape the usual SQL special characters, namely  
backslashes etc if this stuff occurs in your data. It’s an SQL thing,  
not a  
Ruby thing though. 🙂
