Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
2 dummy questions
Message
From
02/09/1999 09:49:22
 
 
To
28/08/1999 08:20:13
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00258791
Message ID:
00260567
Views:
16
Since Ross gave you an answer for the second question, I try the first one.

Why don't you like using an IF? It could look like this:
IF EXISTS(SELECT * FROM current where ...)
  SELECT * FROM current where ...
ELSE
  SELECT * FROM history where ...  
If it wasn't a current or history situation, in other words the query might find rows in both tables, you could do something like this:
SELECT * FROM current WHERE ...
UNION
SELECT * FROM history WHERE ...
-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform