If I have a query that says
I get what I would expect (all sales in that territory). So now I want to store the '05', '20' in a table so that I can change the territory
so hopefully the code would look like
only problem I am running into is - what do I put in @TheseTerritories in the database?
I have tried storing these into the DB without success
1) 05 20
2) '05', '20'
3) ('05', '20')
and many other options - so I am missing something silly - Storing a single value (ex just 05) works just peachy... so what am I missing? How can I store the list that the 'in' clause would work?
Code:
select *
from SalesTable
where Territory in ('05', '20')
I get what I would expect (all sales in that territory). So now I want to store the '05', '20' in a table so that I can change the territory
so hopefully the code would look like
Code:
select *
from SalesTable
where Territory in (@TheseTerritories)
only problem I am running into is - what do I put in @TheseTerritories in the database?
I have tried storing these into the DB without success
1) 05 20
2) '05', '20'
3) ('05', '20')
and many other options - so I am missing something silly - Storing a single value (ex just 05) works just peachy... so what am I missing? How can I store the list that the 'in' clause would work?