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


Groups > comp.databases.ms-sqlserver > #1250

Re: SQL Cursors

From sim <simisa@tiscalinet.it>
Newsgroups comp.databases.ms-sqlserver
Subject Re: SQL Cursors
Date 2012-09-05 13:00 +0200
Organization Netfront http://www.netfront.net/
Message-ID <k27bci$19h8$1@adenine.netfront.net> (permalink)
References <k24s53$1ph$1@news.newsland.it> <k2577t$kqr$1@dont-email.me> <k26rme$tgn$1@adenine.netfront.net> <k278v1$sq0$1@dont-email.me>

Show all headers | View raw


On 2012-09-05 10:18:34 +0000, Bob Barrows said:

> sim wrote:
>> On 2012-09-04 15:27:18 +0000, Bob Barrows said:
>> 
>>> simisa wrote:
>>>> Hallo all,
>>>> I have a problem to resolv asap...I hope that somebody can help me
>>>> 
>>>> 1 Table called classage
>>>> 
>>>> agent1     10000   value2     1
>>>> agent2     8000     value2     2
>>>> agent3     7500     value2     3
>>>> agent4     1000     value2     4
>>>> ...
>>>> 
>>>> The table is order by rank desc.
>>>> I need to update the value2 like this:
>>>> 
>>>> agent1     10000   0             1
>>>> agent2     8000     2000       2
>>>> agent3     7500     500         3
>>>> agent4     1000     6500       4
>>>> 
>>>> 
>>>> Is it possible ?
>>>> 
>>> Yes, it is certainly possible. Without cursors.
>>> 
>>> What version of sql server (this is very relevant for this question)?
>>> What are the column names and datatypes? What is the primary key of
>>> the table? You can best answer the latter two questions by using
>>> SSMS (or EM, depending on your sql version) to generate the
>>> table-creation DDL script for the table and posting it.
>> 
>> Hallo,
>> here we are:
>> 
>> Table CLASSAGE:
>> 
>> agents varchar(50) Checked
>> netto decimal(38, 2) Checked
>> netto2 decimal(38, 2) Checked
>> num int Checked
>> 
>> 
>> where num is the ranking and netto2 is the calculated value to obtain.
>> No ID/Identity.
>> 
> 
> You failed to answer my very first question!
> What version of sql server are you using? I really do need to know this!

Sorry !!! it's a sql2000 sp3

I work with DTS.

I have the possibility to work on sql2008r2, not a problem.

Thanks


--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

SQL Cursors simisa@tiscalinet.it (simisa) - 2012-09-04 14:29 +0200
  Re: SQL Cursors "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2012-09-04 11:27 -0400
    Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-05 08:32 +0200
      Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 06:18 -0400
        Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-05 13:00 +0200
          Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 07:45 -0400
            Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-05 18:19 +0200
            Re: SQL Cursors rja.carnegie@gmail.com - 2012-09-05 15:36 -0700
              Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 18:44 -0400
                Re: SQL Cursors rja.carnegie@gmail.com - 2012-09-05 16:58 -0700
                Re: SQL Cursors Gene Wirchenko <genew@ocis.net> - 2012-09-05 17:23 -0700
                Re: SQL Cursors rja.carnegie@gmail.com - 2012-09-06 02:50 -0700
              Re: SQL Cursors "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-09-05 18:44 -0400
                Re: SQL Cursors sim <simisa@tiscalinet.it> - 2012-09-06 09:37 +0200

csiph-web