Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Error "Version date of last upgrade: 10/11/90"

Author  Topic 

celsius
Starting Member

26 Posts

Posted - 2006-06-23 : 05:24:28
What is the cause of the error "Version date of last upgrade: 10/11/90"?

nr
SQLTeam MVY

12543 Posts

Posted - 2006-06-23 : 05:51:15
Where do you get the error?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

celsius
Starting Member

26 Posts

Posted - 2006-06-23 : 06:06:38
^When I call a certain stored procedure(SP A). SP A calls another stored procedure(SP B). I actually suspect SP B is the cause of the error since when I removed the execution statement of SP B from SP Athe error did not appear. I can't determine which part in SP is the problem. MSDN doesnt have a complete information about the error. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_syserrors1_0cqh.asp
Go to Top of Page

celsius
Starting Member

26 Posts

Posted - 2006-06-23 : 06:13:22
Below is the code of SP B:

ALTER PROCEDURE dbo.SPB @Action char(1) = NULL,
@Amount decimal = NULL,
@CashBalance decimal = NULL,
@TransactionDate datetime = NULL,
@Type varchar(20) = NULL,
@BalanceLedgerID int = NULL,
@LoadOrderID int = NULL,
@PaymentID int = NULL,
@ContactID int = NULL,
@AccessMobile varchar(20) = NULL,
@ErrorCode int = NULL OUTPUT,
@ErrorMessage varchar(260) = NULL OUTPUT
AS



SET NOCOUNT ON


DECLARE @ErrorMessage1 varchar(50),
@IsInternalTransaction char(1)


SET @ErrorCode = 0
SET @ErrorMessage = 'Success.'

SET @ErrorMessage1 = 'SPB failed. '



IF @@TRANCOUNT = 0
SET @IsInternalTransaction = 'Y'



--Validate @Action
IF(@Action IS NULL OR @Action = '')
BEGIN
SET @ErrorCode = 1
SET @ErrorMessage = @ErrorMessage1 + 'Action is required.'

GOTO LABEL_Exit
END

ELSE
BEGIN
IF @Action NOT IN ('S', 'R', 'B')
BEGIN
SET @ErrorCode = 1
SET @ErrorMessage = @ErrorMessage1 + 'Action is invalid.'

GOTO LABEL_Exit
END
END



IF(@Amount IS NULL OR @Amount < 0)
SET @Amount = 0



--Validate @CashBalance
IF(@CashBalance IS NULL)
BEGIN
SET @ErrorCode = 1
SET @ErrorMessage = @ErrorMessage1 + 'CashBalance is required.'

GOTO LABEL_Exit
END



--Validate @TransactionDate
IF(@TransactionDate IS NULL)
SET @TransactionDate = GETDATE()



--Validate @Type
IF(@Type IS NULL OR @Type = '')
BEGIN
SET @ErrorCode = 1
SET @ErrorMessage = @ErrorMessage1 + 'Type is required.'

GOTO LABEL_Exit
END

ELSE
BEGIN
IF @Type NOT IN ('L', 'M', 'G')
BEGIN
SET @ErrorCode = 1
SET @ErrorMessage = @ErrorMessage1 + 'Type is invalid.'

GOTO LABEL_Exit
END
END



IF(@AccessMobile IS NULL OR @AccessMobile = '')
BEGIN
SET @ErrorCode = 1
SET @ErrorMessage = @ErrorMessage1 + 'AccessMobile is required.'

GOTO LABEL_Exit
END
ELSE
BEGIN
SET @AccessMobile = LTRIM(RTRIM(@AccessMobile))

SET @AccessMobile = dbo.FormatMobileNumber('I', @AccessMobile)


IF @AccessMobile NOT IN (SELECT AccessMobile FROM dbo.AccessMobiles)
BEGIN
SET @ErrorCode = 1
SET @ErrorMessage = @ErrorMessage1 + @AccessMobile + ' does not exist in dbo.AccessMobiles.'

GOTO LABEL_Exit
END
END





DECLARE @TempTransactionDate datetime,
@IsLatestTransactionDate char(1)


SELECT TOP 1 @TempTransactionDate = AL.TransactionDate
FROM dbo.AccountLedger AL

INNER JOIN dbo.Contacts C
ON AL.ContactID = C.ContactID AND
AL.AccessMobile = C.AccessMobile

WHERE C.ContactID = @ContactID AND
C.IsDeleted IS NULL AND
AL.AccessMobile = @AccessMobile

ORDER BY AL.TransactionDate DESC

IF (@TempTransactionDate > @TransactionDate) AND (@TempTransactionDate IS NOT NULL)
SET @IsLatestTransactionDate = 'N'





IF @IsInternalTransaction = 'Y'
BEGIN TRANSACTION

INSERT INTO dbo.AccountLedger (
[Action],
Amount,
CashBalance,
TransactionDate,
Type,
BalanceLedgerID,
LoadOrderID,
PaymentID,
ContactID,
AccessMobile
)
VALUES (
@Action,
@Amount,
@CashBalance,
@TransactionDate,
@Type,
@BalanceLedgerID,
@LoadOrderID,
@PaymentID,
@ContactID,
@AccessMobile
)

IF(@@ERROR > 0)
BEGIN
SET @ErrorCode = @@ERROR

IF @ErrorCode > 0
GOTO LABEL_GetDatabaseErrorMessage
END


DECLARE @ID int

SET @ID = @@IDENTITY




IF @IsLatestTransactionDate = 'N'
BEGIN
DECLARE @TempID int,
@TempAction char(1),
@TempCashBalance decimal,
@TempAmount decimal,
@PrevCashBalance decimal





DECLARE accountLedgerCursor CURSOR FOR
SELECT AL.[ID],
AL.[Action],
AL.CashBalance,
AL.Amount
FROM dbo.AccountLedger AL

LEFT OUTER JOIN dbo.TABLE1 LB
ON
( AL.BalanceLedgerID = LB.BalanceID ) AND
(
(AL.BalanceLedgerID IS NOT NULL AND AL.BalanceLedgerID > 0) AND
(LB.BalanceID IS NOT NULL AND LB.BalanceID > 0)
) AND
(AL.AccessMobile = LB.AccessMobile)

LEFT OUTER JOIN dbo.TABLE2 SMT
ON
( AL.BalanceLedgerID = SMT.[ID] ) AND
(
(AL.BalanceLedgerID IS NOT NULL AND AL.BalanceLedgerID > 0) AND
(SMT.[ID] IS NOT NULL AND SMT.[ID] > 0)
) AND
(AL.AccessMobile = SMT.AccessMobile)

LEFT OUTER JOIN dbo.TABLE4 GCT
ON
( AL.BalanceLedgerID = GCT.[ID] ) AND
(
(AL.BalanceLedgerID IS NOT NULL AND AL.BalanceLedgerID > 0) AND
(GCT.[ID] IS NOT NULL AND GCT.[ID] > 0)
) AND
(AL.AccessMobile = GCT.AccessMobile)

LEFT OUTER JOIN dbo.Payments P
ON
( AL.PaymentID = P.[ID] ) AND
(
(AL.PaymentID IS NOT NULL AND AL.PaymentID > 0) AND
(P.[ID] IS NOT NULL AND P.[ID] > 0)
) AND
( AL.AccessMobile = P.AccessMobile )

LEFT OUTER JOIN dbo.TABLE3 C
ON
( AL.ContactID = C.ContactID ) AND
(
(AL.ContactID IS NOT NULL AND AL.ContactID > 0) AND
(C.ContactID IS NOT NULL AND C.ContactID > 0)
) AND
( AL.AccessMobile = C.AccessMobile )

WHERE AL.AccessMobile = @AccessMobile AND
AL.ContactID = @ContactID AND
AL.TransactionDate >= @TransactionDate AND
AL.[ID] <> @ID AND
C.IsDeleted IS NULL

ORDER BY AL.TransactionDate


OPEN accountLedgerCursor

SET @PrevCashBalance = @CashBalance

FETCH NEXT FROM accountLedgerCursor INTO @TempID, @TempAction, @TempCashBalance, @TempAmount


WHILE @@FETCH_STATUS = 0
BEGIN
IF @TempAction = 'S'
BEGIN
UPDATE dbo.AccountLedger
SET CashBalance = @PrevCashBalance - @TempAmount
WHERE [ID] = @TempID

SET @ErrorCode = @@ERROR

IF @ErrorCode > 0
GOTO LABEL_GetDatabaseErrorMessage
END

ELSE IF @TempAction = 'R'
BEGIN
UPDATE dbo.AccountLedger
SET CashBalance = @PrevCashBalance + @TempAmount
WHERE [ID] = @TempID

SET @ErrorCode = @@ERROR

IF @ErrorCode > 0
GOTO LABEL_GetDatabaseErrorMessage
END

SELECT @CashBalance = CashBalance
FROM dbo.AccountLedger
WHERE [ID] = @TempID

SET @PrevCashBalance = @CashBalance

FETCH NEXT FROM accountLedgerCursor INTO @TempID, @TempAction, @TempCashBalance, @TempAmount
END


CLOSE accountLedgerCursor

DEALLOCATE accountLedgerCursor
END


GOTO LABEL_CommitTransaction



------------------------------
LABEL_GetDatabaseErrorMessage:
------------------------------
SELECT @ErrorMessage = [description]
FROM master.dbo.sysmessages
WHERE error = @ErrorCode

GOTO Label_RollbackTransaction




------------------------
LABEL_CommitTransaction:
------------------------
IF @IsInternalTransaction = 'Y'
COMMIT TRANSACTION

GOTO LABEL_Exit



------------------------
LABEL_RollbackTransaction:
------------------------
IF @IsInternalTransaction = 'Y'
ROLLBACK TRANSACTION


-----------
LABEL_Exit:
-----------
IF @IsInternalTransaction = 'Y'
SELECT @ErrorCode AS 'ErrorCode', @ErrorMessage AS 'ErrorMessage'
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2006-06-23 : 06:56:54
I doubt if this is anything to do with sql server but is a user error message.
Have a look in sysmessages for the error message - probably a user defined message.
The text isn't in the SP so it's getting it from somewhere external.
The other option is that it's being returned from a trigger.

Also search through syscomments to see if the text is there.



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -