Results 1 to 6 of 6

Thread: [RESOLVED] insert into TSQL

  1. #1

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Resolved [RESOLVED] insert into TSQL

    how to insert special characters like ' or & or [] ... etc
    with INSERT INTO statement.
    with out replacing them

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: insert into TSQL

    Is this directly in SSMS or though a front end?

    If front end the best option is to use parameterized queries. Second option is to use replace (if using concatinated SQL string) someVar.Replace"'","''")

    If in SSMS then the single qoute (') needs to be two of them ('')
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: insert into TSQL

    Assuming it is through a front end... For an explanation of why you should be using parameters (and links to code examples), see the article Why should I use Parameters instead of putting values into my SQL string? from our Database Development FAQs/Tutorials (at the top of this forum).

  4. #4

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Question Re: insert into TSQL

    thank u sir
    normally i work with MSaccess03
    may i know what are the conflicting characters which i must
    take care of please.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: insert into TSQL

    Do you mean that you are working manually in Access itself? ..or that you are interacting with a database from a VB program?

    If it is from a VB program (to any database system), read the article I linked to.

  6. #6

    Thread Starter
    PowerPoster make me rain's Avatar
    Join Date
    Sep 2008
    Location
    india/Hubli
    Posts
    2,208

    Wink Re: insert into TSQL

    thank u very much sir

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width