Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Complex SQL - what would be the best solution?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
Complex SQL - what would be the best solution?
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01345823
Message ID:
01345823
Vues:
56
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform