Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Monster select
Message
From
20/11/2001 10:23:57
 
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
00583822
Message ID:
00583938
Views:
22
It's really hard to explain.
The select is being build in a loop. Each loop builds a select statement with different parameters to a maximum length of about 3500 characters. Each select needs to be joined together as below:-

--main
select * into table1
from table2 t2
--loop 1
( Select * from table3 ) t3
left outer join
on t2.id = t3.id
--loop 2
( Select * from table4 ) t4
left outer join
on t2.id = t4.id
--loop 3
( Select * from table5 ) t5
left outer join
on t2.id = t5.id

-- 24 times

Hope the example helps

James
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform