TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: All
from: Adam Flinton
date: 2004-06-28 22:00:28
subject: Re: SQL Server stored procedure help

From: Adam Flinton 

Robert Comer wrote:
> Is there a way to make the following SQL statement single level?
>
> SELECT      WorkOrder.WRKNO, WorkOrder.RELNO, CombOrder.CO_ID,
> CombOrder.LOTID, SFC_Colors.COLOR,
>                    SFC_Colors.COLOR_ID,
>                    LISTCOL = (CONVERT(char(6), WorkOrder.WRKNO) + '  ' +
> CombOrder.LOTID + '  ' + SFC_Colors.COLOR)
> FROM         WorkOrder INNER JOIN CombOrder ON WorkOrder.WO_ID =
> CombOrder.WO_ID LEFT OUTER JOIN
>                        SFC_Colors ON CombOrder.COLOR_ID =
> SFC_Colors.COLOR_ID
> WHERE      (WorkOrder.ACTIVE = 1 AND CombOrder.ACTIVE = 1)
> ORDER BY WorkOrder.WRKNO, CombOrder.LOTID
>
> It's giving me a headache just thinking about it.
>
> The reason I want to go single level is that a program I have is trying to
> open a cursor on the above procedure and any SQL server ODBC driver in the
> last 6 years throws an error that says you can't open a cursor on a SP that
> has more than 1 select.
>
> Thanks,
>
> - Bob Comer
>
>

How about an intermediate view?

Adam

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270
@PATH: 379/45 1 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.