This is a discussion on data lost within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> I have a stored procedure and I called it from my c# application. When I called my stored procedure, ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a stored procedure and I called it from my c# application. When I called my stored procedure, I have this problem: The input is a list. If the list has 2 elements, none is selected. If it has more than 2 elements, the first and the last one will not be selected. E.g. if my input string is 'a,b,c,d', Only b and c are handled. Here is the code: SqlCommand cmd = null; cmd=new SqlCommand ("RCS_CreateAffiliatePayouts", conn); cmd.CommandType = CommandType.StoredProcedure; SqlParameter cons = cmd.Parameters.Add ("@cons", SqlDbType.VarChar, 8000); cons.Direction = ParameterDirection.Input; cons.Value = "'a,b,c,d'"; cmd.ExecuteNonQuery (); The stored procedure is like: CREATE PROCEDURE RCS_CreateAffiliatePayouts2 @cons varchar(8000) AS Declare @type int set @type=2 INSERT RCS_Payouts SELECT CURRENT_TIMESTAMP, balance, @type, AffiliateCode FROM RCS_Affiliates a1 INNER JOIN iter_charlist_to_table(@cons, DEFAULT) s1 ON a1.AffiliateCode= s1.code ; GO Thanks. |