December 10, 2005 at 1:51 am
Dear all,
I have a probelm with a return sqlparameter. I am developing with C#.Net and ADO.Net. I use MS SQL 2000 sp3. now I get a reutrn value of sql parameter is int even though the parameter variable of store procedure is smallint. SQL store procedure can't return smallint?
Pls help me as soon as possible..
Thank a lot.
December 10, 2005 at 8:01 am
Can you give snippets of your C# and T-SQL stored procedure? Make sure that you clean up any code to hide anything that might be sensitive your organization. That would help us figure out what's going on.
K. Brian Kelley
@kbriankelley
December 12, 2005 at 7:50 am
You need to look at your C# parameter set up. It was confused while I used that.
December 12, 2005 at 9:34 am
The return value of a stored proc is always an int. If you use a smaller type, like tinyint or smallint, it will be converted. If you try to return something like a varchar, it will return an error.
You can use an OUTPUT parameter to return a different type.
Dylan Peters
SQL Server DBA
December 12, 2005 at 2:47 pm
You might consider using a user defined function rather than a stored procedure.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply