Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16220

Re: ADODB and SQL Server rowversion Columns

From Ross McKay <au.org.zeta.at.rosko@invalid.invalid>
Newsgroups comp.lang.javascript
Subject Re: ADODB and SQL Server rowversion Columns
Message-ID <77ha681egee9qftqkobb565omi8066mamq@4ax.com> (permalink)
References <397a68lojjat5g9mpdqoqkhivee4j4ia36@4ax.com>
Organization EasyNews, UseNet made Easy!
Date 2012-09-28 16:36 +1000

Show all headers | View raw


On Thu, 27 Sep 2012 21:00:29 -0700, Gene Wirchenko wrote:

>     I am trying to add rowversion handling to my SQL Server database.
>
>     I can request a row and get it sent to the Web server
>(server-side JavaScript) using ADODB.  I can pick up all of the column
>values (as I have done for some time) except for the rowversion.
>[...]
>     What do I do with the RS.Field(i) object to serialise the
>rowversion value?

Some data types supported by ADO just aren't supported by ASP. You could
mess around with bytes and sums and ADODB binary streams, or...

I suggest you cast it from rowversion to bigint in the select statement,
and then if you need to return it to the server and compare, cast it
back from bigint to rowversion.

e.g.

select a,b,c,convert(bigint, rv) as rv from example

update example set ... where a=@a and rv=convert(rowversion,@rv)
-- 
Ross McKay, Toronto, NSW Australia
"Let the laddie play wi the knife - he'll learn"
- The Wee Book of Calvin

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ADODB and SQL Server rowversion Columns Gene Wirchenko <genew@ocis.net> - 2012-09-27 21:00 -0700
  Re: ADODB and SQL Server rowversion Columns Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-09-28 16:36 +1000
    Re: ADODB and SQL Server rowversion Columns Gene Wirchenko <genew@ocis.net> - 2012-09-28 10:38 -0700
      Re: ADODB and SQL Server rowversion Columns Gene Wirchenko <genew@ocis.net> - 2012-10-02 17:37 -0700
        Re: ADODB and SQL Server rowversion Columns Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-10-03 20:53 +1000
          Re: ADODB and SQL Server rowversion Columns Gene Wirchenko <genew@ocis.net> - 2012-10-03 16:38 -0700
            Re: ADODB and SQL Server rowversion Columns Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-10-04 12:02 +1000

csiph-web