|
Posted by bubbles on 03/30/07 05:59
Solved this problem using cursors.
Thanks!
On Mar 29, 8:10 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
>
> First lesson in SQL: stop think in loops. The normal approach is that you
> handle all data at once as in the query that I showed you. There are
> exceptions when looping may be called for, or may be the best solution,
> but nothing you have said this far, indicates that this would be necessary.
>
> Since I don't know what the queries against TableB look like, I cannot
> assist more than with the example I provided. I forgot to mention that
> it runs in the Northwind database. (Which does not ship with SQL 2005,
> but is on SQL 2000, and can be downloaded from Microsoft.com.)
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|