I have the following SQL as a stored proc:
@Branch varchar(255)
AS
Select
MTGTERMS.LOAN_NUM as loan_number,
br.BRANCH as branch
from
XX_MTGTERMS as MtgTerms
INNER JOIN XX.BRANCH_INFO
as br on MtgTerms.lnkey = br.lnkey
where
br.BRANCH IN (@Branch)
(This is abbreviated, but forms the core of the issue).
@Branch is loaded when the proc is called with input from the user - via Crystal Reports (which actually calls the proc) with a JOINed array of values (all string values) such as 204,458,789.
The report, when run, shows that the user input is being captured by Crystal and passed on to the SP, but there are no results.
If I run the SQL with the
WHERE
br.BRANCH IN ('0248','4372','5202')
I get a raft of data.
When I do an EXEC
[dbo].[SLS045_Registration_Quality] @Branch = '0248,4372,5202'
as a test, I receive no data.
This fails:
exec [dbo].[SLS045_Registration_Quality] @Branch = "0248,4372,5202"
as does this:
exec [dbo].[SLS045_Registration_Quality] @Branch = "'0248','4372','5202'"
ltimately, I'm trying to get
br.BRANCH IN (@Branch)
to work....
any clues as to where to go from here?
Thanks
@Branch varchar(255)
AS
Select
MTGTERMS.LOAN_NUM as loan_number,
br.BRANCH as branch
from
XX_MTGTERMS as MtgTerms
INNER JOIN XX.BRANCH_INFO
as br on MtgTerms.lnkey = br.lnkey
where
br.BRANCH IN (@Branch)
(This is abbreviated, but forms the core of the issue).
@Branch is loaded when the proc is called with input from the user - via Crystal Reports (which actually calls the proc) with a JOINed array of values (all string values) such as 204,458,789.
The report, when run, shows that the user input is being captured by Crystal and passed on to the SP, but there are no results.
If I run the SQL with the
WHERE
br.BRANCH IN ('0248','4372','5202')
I get a raft of data.
When I do an EXEC
[dbo].[SLS045_Registration_Quality] @Branch = '0248,4372,5202'
as a test, I receive no data.
This fails:
exec [dbo].[SLS045_Registration_Quality] @Branch = "0248,4372,5202"
as does this:
exec [dbo].[SLS045_Registration_Quality] @Branch = "'0248','4372','5202'"
ltimately, I'm trying to get
br.BRANCH IN (@Branch)
to work....
any clues as to where to go from here?
Thanks