- Mar 1, 2000
- 30,890
- 5,001
- 126
I have and IN statement that is used in about 25+ (and growing) different queries.
The IN statement contains about 125 different codes (and growing)
When I need to add or delete codes from this IN statement, I'd like to just update the list in ONE spot, not in 25+ different queries.
Is there a way to do that?
I've tried to "cheat" and create a table with e single column row that has all my codes in there:
'ABC', 'DEF', 'GHI'....'XYZ', etc (set to varchar(MAX)
and then in my queries do something like:
WHERE ACTIVE.CODE IN (SELECT * FROM CODE_TABLE)
But that doesn't seem to work.
Anyone have any suggestions?
I probably explained it horribly.
The IN statement contains about 125 different codes (and growing)
When I need to add or delete codes from this IN statement, I'd like to just update the list in ONE spot, not in 25+ different queries.
Is there a way to do that?
I've tried to "cheat" and create a table with e single column row that has all my codes in there:
'ABC', 'DEF', 'GHI'....'XYZ', etc (set to varchar(MAX)
and then in my queries do something like:
WHERE ACTIVE.CODE IN (SELECT * FROM CODE_TABLE)
But that doesn't seem to work.
Anyone have any suggestions?
I probably explained it horribly.
