Re: embedded ' in strings
From: mgarner1980 (mgarner_at_kbsi.com)
Date: 07/14/04
- Next message: mgarner1980: "Re: sqlce: nvarchar(80) vs. ntext"
- Previous message: Eric Wood: "Re: select permission required on msdb..MSagent_profiles?"
- In reply to: Brad Syputa - MS: "RE: embedded ' in strings"
- Next in thread: Brad Syputa - MS: "Re: embedded ' in strings"
- Reply: Brad Syputa - MS: "Re: embedded ' in strings"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 18:01:04 -0500
Sorry should've followed up on this one. Here's what was happening. The
field I was trying to use the where clause on was a CHAR length 6.
So let's say the user types in 123'45. My function would turn it in to
123''45. which is length 7. When I tried to execute the query I would get
the null reference exception.
So for now if there's a ' I throw it out. it's either that or truncate it to
six characters.
The thing that had me going was that the same queries worked fine insql
query analyzer for the desktop. BTW the same error also occures in th esqlce
query analyzer if you want to see what I'm talking about. It seems like a
bogus error since once the "escape" is processed, the end result should be a
string length 6.
""Brad Syputa - MS"" <bradsy@Online.Microsoft.com> wrote in message
news:j9UqnzDaEHA.3272@cpmsftngxa06.phx.gbl...
> Hi mgarner,
>
> Can you explain a little better how it throws a null reference exception?
I
> us a double single quote and it works fine for me.
>
>
> --------------------
> | From: "mgarner1980" <mgarner@kbsi.com>
> | Subject: embedded ' in strings
> | Date: Fri, 9 Jul 2004 15:24:14 -0500
> | Lines: 13
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
> | Message-ID: <u4i30KfZEHA.3092@tk2msftngp13.phx.gbl>
> | Newsgroups: microsoft.public.sqlserver.ce
> | NNTP-Posting-Host: 209.189.225.79
> | Path:
>
cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
> 8.phx.gbl!tk2msftngp13.phx.gbl
> | Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.ce:12805
> | X-Tomcat-NG: microsoft.public.sqlserver.ce
> |
> | I'm having problems with queries like the following in sqlserverce.
> |
> | select name from employee where lastname = 'O'Brien'
> |
> | If I use double single quote like O''Brien, that works fine on my
> sqlser2000
> | server, but throws a null reference error on sqlserverce merge
> | subscription.
> |
> | I've tried paramaterized queries with to no avail as well.
> |
> | Any ideas?
> |
> |
> |
>
- Next message: mgarner1980: "Re: sqlce: nvarchar(80) vs. ntext"
- Previous message: Eric Wood: "Re: select permission required on msdb..MSagent_profiles?"
- In reply to: Brad Syputa - MS: "RE: embedded ' in strings"
- Next in thread: Brad Syputa - MS: "Re: embedded ' in strings"
- Reply: Brad Syputa - MS: "Re: embedded ' in strings"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|