Hi this is Cindy Priya..
This is my
VB Code trying to execute a SP called "CAMS_GetNextStudentId"
Dim varNewStudentID as Variant
dbcommand.CommandType = adCmdStoredProc
dbcommand.CommandText = "CAMS_GetNextStudentId"
dbcommand.Parameters.Append _
dbcommand.CreateParameter("varNewStudentID", adBigInt, adParamOutput)
dbcommand.ActiveConnection = conn
dbcommand.Execute
Here is my actual Stored procedure. When i execute this from Sql server it just works fine but when i run this SP from
VB(above code) it gives an error..
"The conversion of the varchar value '21100000000000111' overflowed an int column. Maximum integer value exceeded"
CREATE Procedure [dbo].CAMS_GetNextStudentID
@Value varchar(20) OUTPUT
AS
SET NOCOUNT ON
Begin Transaction
Declare @NextID as bigInt
if exists(Select StudentIdSeq From CAMSConfig)
begin
Select @NextID = CAST(StudentIDSeq as bigInt) from CAMSConfig With(Tablockx)
Update CAMSConfig set StudentIDSeq = Cast(@NextID + 1 as VarChar(20))
Set @Value = cast((@NextID) as varchar(20))
end
Commit
Return @Value
GO
Any idea what might caused the problem and any solution that you can think of.. Let me know