Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gvmk27
Starting Member
44 Posts |
Posted - 2012-02-28 : 10:53:57
|
HiI have s string parameter to the stored procedure (SP) like '10000004','10000101','10000005','10000106'. In the SP, I'm using IN keywordbut its not giving any result...if I execute as SQL its returning the correct results, below is the SPALTER PROCEDURE [dbo].[usp_Branch_ByRegionId_Get] -- Add the parameters for the stored procedure here @RegionId nvarchar(50)ASBEGIN SELECT WB.BranchID, WB.BranchName FROM WebBranch WB INNER JOIN KUMON2000.dbo.Branch B ON B.BranchID = WB.BranchID INNER JOIN KUMON2000.dbo.GMOffice GM ON GM.GMOfficeID = B.GMOfficeID AND GM.RegionID IN (@RegionId)ENDif I execute as a SQL, it will run perfectly..SELECT WB.BranchID, WB.BranchNamefrom WebBranch WB INNER JOIN KUMON2000.dbo.Branch B ON B.BranchID = WB.BranchIDINNER JOIN KUMON2000.dbo.GMOffice GM ON GM.GMOfficeID = B.GMOfficeIDand GM.RegionID IN ('10000004','10000101','10000005','10000106')Thanks for ur help in advance... |
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2012-02-28 : 10:54:54
|
here's the arrays / lists bible for sql server.http://www.sommarskog.se/arrays-in-sql.htmlall your answers are there.Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2012-02-28 : 11:06:43
|
or you can use an xml payload that your sproc consumes. another option easier to manage<><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|
|