USE [PS_GameData]
GO
/****** Object: StoredProcedure [dbo].[usp_Save_User_BuyPointItems_NCash] Script Date: 06/22/2013 18:36:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Shoping Mall Fixed by sandolkakos Website: ******/
ALTER Proc [dbo].[usp_Save_User_BuyPointItems_NCash]
2013-06-22 19:17:46 err=-1, [Microsoft][ODBC SQL Server Driver][SQL Server]La conversión del tipo de datos varchar en datetime produjo un valor fuera de intervalo., SQL STATE: 22007, NATIVE ERROR: 242 (0xF2)
2013-06-22 19:17:46 SaveBuyPointItem 7 Leon qerr=0, {?=call usp_Save_User_BuyPointItems_NCash(1,7,0,'B1_Cface0 001','2013-06-22 19:17:46')}
2013-06-22 19:16:58 err=-1, [Microsoft][ODBC SQL Server Driver][SQL Server]Error al convertir el tipo de datos varchar a datetime., SQL STATE: 42000, NATIVE ERROR: 8114 (0x1FB2)
2013-06-22 19:16:58 err=-1, [Microsoft][ODBC SQL Server Driver][SQL Server]Error al convertir el tipo de datos varchar a datetime., SQL STATE: 42000, NATIVE ERROR: 8114 (0x1FB2)
2013-06-22 19:17:34 err=-1, [Microsoft][ODBC SQL Server Driver][SQL Server]Error al convertir el tipo de datos varchar a datetime., SQL STATE: 42000, NATIVE ERROR: 8114 (0x1FB2)
2013-06-22 19:17:46 err=-1, [Microsoft][ODBC SQL Server Driver][SQL Server]Error al convertir el tipo de datos varchar a datetime., SQL STATE: 42000, NATIVE ERROR: 8114 (0x1FB2)
2013-06-22 19:17:46 err=-1, [Microsoft][ODBC SQL Server Driver][SQL Server]Error al convertir el tipo de datos varchar a datetime., SQL STATE: 42000, NATIVE ERROR: 8114 (0x1FB2)
2013-06-22 19:17:46 err=-1, [Microsoft][ODBC SQL Server Driver][SQL Server]Error al convertir el tipo de datos varchar a datetime., SQL STATE: 42000, NATIVE ERROR: 8114 (0x1FB2)
ALTER Proc [dbo].[usp_Save_User_BuyPointItems_NCash]
@UserUID int,
@CharID int,
@UsePoint int,
@ProductCode varchar(20),
@textDate varchar(30)
AS
DECLARE @UseTime datetime
set @UseTime=CONVERT(datetime, @textDate, 120)
so far so good, it receives:
1 as an int stored in @UserUID
7 as an int stored in @CharID
0 as an int stored in @UsePoint
'B1_Cface0 001' as varchar(20) (it is 13 char long) stored in @ProductCode
'2013-06-22 19:17:46' as varchar(30) (it is 29 char long) stored in @textDate
then you convert that "ODBC canonical" date into a datetime field using the convert function with the right parameter (120 means it is "ODBC canonical").
*w/o surptise* the log doesn't contain something like, "invalid argument for convert function", nor "unknown convert function", nor "invalid argument for assignment / invalid value for @UseTime field" or whatever close to that.
that does not use date (and the log does contain a date related error).
so last statement:
INSERT INTO PointLog(UseType,UserUID,CharID,UsePoint,ProductCo de,UseDate)
VALUES(@UseType,@UserUID,@CharID,@UsePoint,@Produc tCode,@textDate)
where we need about 3 seconds to figure out that the string-field-containing-an-OBDC-string-date-that-the-server-can-NOT-handle-by-itself parameter (the "textDate" variable) is used instead of the @UseTime variable, the one we introduced to handle that error ...
thanks thanks thanks you are awesome thanks for all the help more than says the errors, explaining to us how to fix them and how to understand why they happen
ALTER Proc [dbo].[usp_Save_User_BuyPointItems_NCash]
@UserUID int,
@CharID int,
@UsePoint int,
@ProductCode varchar(20),
@textDate varchar(30)
AS
DECLARE @UseTime datetime
set @UseTime=CONVERT(datetime, @textDate, 120)
so far so good, it receives:
1 as an int stored in @UserUID
7 as an int stored in @CharID
0 as an int stored in @UsePoint
'B1_Cface0 001' as varchar(20) (it is 13 char long) stored in @ProductCode
'2013-06-22 19:17:46' as varchar(30) (it is 29 char long) stored in @textDate
then you convert that "ODBC canonical" date into a datetime field using the convert function with the right parameter (120 means it is "ODBC canonical").
*w/o surptise* the log doesn't contain something like, "invalid argument for convert function", nor "unknown convert function", nor "invalid argument for assignment / invalid value for @UseTime field" or whatever close to that.
that does not use date (and the log does contain a date related error).
so last statement:
INSERT INTO PointLog(UseType,UserUID,CharID,UsePoint,ProductCo de,UseDate)
VALUES(@UseType,@UserUID,@CharID,@UsePoint,@Produc tCode,@textDate)
where we need about 3 seconds to figure out that the string-field-containing-an-OBDC-string-date-that-the-server-can-NOT-handle-by-itself parameter (the "textDate" variable) is used instead of the @UseTime variable, the one we introduced to handle that error ...