Re: Text Delimiters



Thanks very much for that, Bill

--
With best wishes


Nigel Vandyk


Website:www.astarsoftware.co.uk
"William (Bill) Vaughn" <billva@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23gCfI2GgHHA.2432@xxxxxxxxxxxxxxxxxxxxxxx
This problem can be solved by either doubling the single quotes as in
... 'O''Malley',...
or (better yet) use Parameters for your input parameters. These solve
other framing issues (as when using dates etc.)

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest books:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and
Hitchhiker's Guide to SQL Server 2005 Compact Edition

-----------------------------------------------------------------------------------------------------------------------

"Nigel Vandyk" <sales@xxxxxxxxxxxxxxxxxxx> wrote in message
news:OzQzfnGgHHA.4064@xxxxxxxxxxxxxxxxxxxxxxx
I am sure that lots of people must know the answer to this but I can't
find it anywhere.

If I want to insert a Firstname and Surname into an SQLCE table called
Clients I would use

INSERT INTO Clients (Firstname,Surname) VALUES('Fred','Bloggs')

but what happens if I want to insert Paddy O'Brian or Michael O'Connor

Because we are using an apostrophe in their names, this will cause the
Insert statement to fail

In Access I would use chr(34) to delimit the strings. Is there a way
round this in SQLSERVERCE?

--
With best wishes


Nigel Vandyk

Website:www.astarsoftware.co.uk





.



Relevant Pages

  • Re: Text Delimiters
    ... or use Parameters for your input parameters. ... Hitchhiker's Guide to SQL Server 2005 Compact Edition ... INSERT INTO Clients VALUES ...
    (microsoft.public.sqlserver.ce)
  • Re: using OpenXML in T-sql?
    ... Columnist, SQL Server Professional ... The author makes a reference to using comma delimited strings and opts for the xml string instead. ... @ID1 INT, @ID2 INT, @ID3 INT, @ID4 INT AS ... ... you're betting you'll never have to specify more values than the number of input parameters you create. ...
    (microsoft.public.sqlserver.programming)
  • Re: command text question for cmdStoredProc command type with TAdoDataset
    ... In MS SQL Server you can have "overloaded" procedures with the same name. ... The report runs just fine as well. ... > is simpler but it has some input parameters. ... For some reason I can't get ...
    (borland.public.delphi.database.ado)
  • Re: Conditional Query
    ... a number of selection criteria based on input parameters. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Passing values to View
    ... > SQL Server 2000 has an alternative called Inline Table-Valued User Defined ... > returns a table based on a SELECT query which can use the input parameters. ... I can do it cheap. ...
    (microsoft.public.sqlserver.clients)

Loading