Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interesting Query Problem
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01518190
Message ID:
01518195
Vues:
53
>>>>except the WHERE clauses come from the CompassQueries table for all rows that match the campaign.
>>>>
>>>>How do I do this?
>>>
>>>
>>>You will need dynamic SQL here, e.g.
>>>
>>>declare @SQL nvarchar(max)
>>>
>>>select @SQL = coalesce(@SQL + '
>>>UNION ALL ','') + 'SELECT VoterID from tblCamp_CT WHERE ' 
>>>+ Query FROM CompassQueries
>>>
>>>print @SQL
>>>
>>>execute (@SQL)
>>
>>Ok, I see what you're doing, excelt what's "Query"?
>
>Query is a field in the CompassQueries table.

Oh oh I see. It's actually called CompassQuery, whih is why I got confused.

Thanks, I'll give it a shot
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform