I've tried to read everything from this thread, but I still get error when executing the scripts. The error line was on EXEC SP_SIEGE_INFO_R saying this error.
I've already cleaned the GUILD_INFO and SIEGE_INFO tables. I'm using SQL Server 2014, hopefully someone could give some hints to fix this? Thanks you in advance.
USE [Character]
GO
/****** Object: UserDefinedFunction [dbo].[FN_BinDateToDateTime] Script Date: 10/12/2020 by ULTIMO ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER FUNCTION [dbo].[FN_BinDateToDateTime] (
@i_bin_time binary(4)
) RETURNS datetime
AS
BEGIN
DECLARE @v_datetime datetime
DECLARE @v_strAux varchar(20)
DECLARE @v_strtime varchar(20)
SET @v_strAux = CAST(CAST(@i_bin_time as int) as varchar(20))
IF len(@v_strAux) = 7
SELECT @v_strtime = '20200' + CAST(CAST(@i_bin_time as int) as varchar(20))
ELSE
IF len(@v_strAux) = 8
SELECT @v_strtime = '2020' + CAST(CAST(@i_bin_time as int) as varchar(20))
ELSE
SELECT @v_strtime = '202' + CAST(CAST(@i_bin_time as int) as varchar(20))
SELECT @v_strtime = SUBSTRING(@v_strtime,1,4)
+'-'+SUBSTRING(@v_strtime,5,2)
+'-'+SUBSTRING(@v_strtime,7,2)
+' '+SUBSTRING(@v_strtime,9,2)
+':'+SUBSTRING(@v_strtime,11,2)
SELECT @v_datetime = CAST(@v_strtime as datetime)
RETURN @v_datetime
END
I've tried to read everything from this thread, but I still get error when executing the scripts. The error line was on EXEC SP_SIEGE_INFO_R saying this error.
I've already cleaned the GUILD_INFO and SIEGE_INFO tables. I'm using SQL Server 2014, hopefully someone could give some hints to fix this? Thanks you in advance.
Did you even read the error? It says the query has too many parameters specified. Clearly you need to compare the SP and see what parameters it takes and adjust your query to match the parameters you're using.
Really it was there all along, all you had to do is read the error.
Did you even read the error? It says the query has too many parameters specified. Clearly you need to compare the SP and see what parameters it takes and adjust your query to match the parameters you're using.
Really it was there all along, all you had to do is read the error.
Paul they don't read any think they just want open the server and get cash
Did you even read the error? It says the query has too many parameters specified. Clearly you need to compare the SP and see what parameters it takes and adjust your query to match the parameters you're using.
Really it was there all along, all you had to do is read the error.
I actually understand that the parameters from the script is over when it's compared to the SP parameters. I just wondered why the other DEVs doesn't get the error line at SP_SIEGE_INFO_R. I tried what you said and compared the script params and SP params they have one difference so I removed it from the script params and tried to execute it and get another error.
"Msg 242, Level 16, State 3, Procedure SP_SIEGE_INFO_R, Line 104
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value."
I am not sure enough if I had to remove or edit something on the given script or just stick to it. Sorry for the trouble, still figuring out how it really works.
USE [Character]
GO
/****** Object: UserDefinedFunction [dbo].[FN_BinDateToDateTime] Script Date: 10/12/2020 by ULTIMO ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER FUNCTION [dbo].[FN_BinDateToDateTime] (
@i_bin_time binary(4)
) RETURNS datetime
AS
BEGIN
DECLARE @v_datetime datetime
DECLARE @v_strAux varchar(20)
DECLARE @v_strtime varchar(20)
SET @v_strAux = CAST(CAST(@i_bin_time as int) as varchar(20))
IF len(@v_strAux) = 7
SELECT @v_strtime = '20200' + CAST(CAST(@i_bin_time as int) as varchar(20))
ELSE
IF len(@v_strAux) = 8
SELECT @v_strtime = '2020' + CAST(CAST(@i_bin_time as int) as varchar(20))
ELSE
SELECT @v_strtime = '202' + CAST(CAST(@i_bin_time as int) as varchar(20))
SELECT @v_strtime = SUBSTRING(@v_strtime,1,4)
+'-'+SUBSTRING(@v_strtime,5,2)
+'-'+SUBSTRING(@v_strtime,7,2)
+' '+SUBSTRING(@v_strtime,9,2)
+':'+SUBSTRING(@v_strtime,11,2)
SELECT @v_datetime = CAST(@v_strtime as datetime)
RETURN @v_datetime
END