Re: parameter names in Sql Server

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jerry Pisk (jerryiii_at_hotmail.com)
Date: 06/13/04

  • Next message: jan hendrickx: "show embedded OLE-field on webpage?"
    Date: Sun, 13 Jun 2004 00:47:12 -0700
    
    

    If you stick to the OLEDB provider (System.Data.OleDb namespace) you can use
    the same classes and ? as parameter placeholders for both Sql Server and
    Oracle.

    Jerry

    "jakez" <jakez@discussions.microsoft.com> wrote in message
    news:C47BDD70-F4AA-48CD-A0CE-AD1EA599A198@microsoft.com...
    > Thanks Bill, that's what I was afraid of. Unfortunately, I am using
    > ADO.NET and am trying to find a way that will allow me to write a single
    > query that can be used with both SQL Server and Oracle. I guess I will
    > have just have to do some parsing in my custom code before the queries are
    > executed to make any necessary changes. Thanks again for your reply.
    >
    >
    >
    >
    > "William (Bill) Vaughn" wrote:
    >
    >> No, the parameter markers are set by the data provider and can't be
    >> changed.
    >> However, when using OLE DB and ADO classic (not ADO.NET), parameters are
    >> marked with "?" in the query and the name is irrelevant. All named
    >> parameter
    >> implementations use the @ character to prefix parameters.
    >>
    >> hth
    >>
    >> --
    >> ____________________________________
    >> William (Bill) Vaughn
    >> Author, Mentor, Consultant
    >> Microsoft MVP
    >> 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.
    >> __________________________________
    >>
    >> "jakez" <jakez@discussions.microsoft.com> wrote in message
    >> news:30CD7FB5-67E7-48CD-8003-4461B6636037@microsoft.com...
    >> > Is there any other naming convention that can be used for parameters in
    >> SqlServer besides the @<paramName> method? Like, possibly another
    >> special
    >> character or something like this... Thanks in advance for any
    >> information.
    >>
    >>
    >>


  • Next message: jan hendrickx: "show embedded OLE-field on webpage?"

    Relevant Pages

    • Re: Conversion error
      ... text (character strings) before importing them into SQL ... I have defined all columns in the SQL Server ... all values properly to varchar. ... money data. ...
      (microsoft.public.sqlserver.dts)
    • RE: strange problem with sql
      ... The difference in the character _ and W is just one bit. ... There are other letters that are getting mistranslated: ... My onlly guess now is that there is a memory ... > that at one occassion the SQL Server executed was changed on one ...
      (microsoft.public.data.ado)
    • Re: BULK COPY changes row order importing Text file
      ... Error = [ODBC SQL Server Driver]Invalid character value for cast ... BCP copy in failed ...
      (microsoft.public.sqlserver.programming)
    • RE: strange problem with sql
      ... The difference in the character _ and W is just one bit. ... There are other letters that are getting mistranslated: ... My onlly guess now is that there is a memory ... > that at one occassion the SQL Server executed was changed on one ...
      (microsoft.public.sqlserver.programming)
    • Re: MS Query Problem
      ... The reason SQL Server deals with it is because you can define fixed length ... The field is a 20 character text string which represents an industry code, ... It would be a very unusual circumstance to keep trailing spaces. ...
      (microsoft.public.access.queries)