Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update query not listening?
Message
 
 
À
13/08/2003 14:13:26
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00819873
Message ID:
00819880
Vues:
12
Darren,

You can make order_seq IDENTITY column and SQL Server will do numbering for you. In your UPDATE command select on the right of '=' excutes only ones at the beginning of the query not for every row because it isn't correlated subquery.

>Can someone tell me why this simple command doesn't work?
>
>update #d2
>set order_seq=(select isnull(max(order_seq),0)+1 from #d2)
>
>All I want it to do is number order_seq 1,2,3 etc. but they all get a 1 (They are all 0 to start with).
>
>Thanks.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform