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.CreateParameter("varNewStudentID", adBigInt, adParamOutput)
dbcommand.ActiveConnection = conn
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
SET NOCOUNT ON
Declare @NextID as bigInt
if exists(Select StudentIdSeq From CAMSConfig)
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))
Any idea what might caused the problem