Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One of four possible children
Message
 
To
04/10/2007 17:11:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01258745
Message ID:
01258757
Views:
12
Create Procedure NoNeedForAnSP @myValue int
 as
select TableP.*, tableX.FK, tableX.sales
 from tableP inner join
 (select * from tableA
  union
  select * from tableB
  union
  select * from tableC
  union
  select * from tableD) tableX
on tableP.PK = tableX.FK
where tableP.PK = @myValue
Brilliant Cetin!! Thank you very much.
Now a followup question (before I give you stars). Your solution works, but at what cost? Does this solution select all the records from TableA, TableB, TableC and TableD and place them into a temporary table TableX?

Thanks,
Einar
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform