Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complex SQL - what would be the best solution?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
Complex SQL - what would be the best solution?
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345823
Message ID:
01345823
Views:
55
Hi everybody,

I have a complex SQL statement consisting of

select * from (first select statement UNION another select UNION another select...) order by

This is defined as a string property of my page class.

Now, I have a field IsActive and in general I want to only select active people. So, I can add condition IsActive = 1 to all union statements.

However, I added a new condition to our SQLQueryBuilder to be able to show inactive people or all people regardless on the status.

The question is - how should I handle this situation now?

Check my query_str for the IsActive in it (BTW, when I tried to see Help for IndexOf it opened some unrelevant content after I pressed F1 in VS2008 having IndexOf highlighted) and add this condition if it's not there - but how then both cases should be handled?

Do you have any good ideas for me?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform