General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only