Unix Technical Forum

data lost

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, ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:32 PM
holly
 
Posts: n/a
Default data lost

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:58 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com