SQL Server command trying to use float(0,0)
Posted: Fri 31 Jul 2020 19:21
I'm evaluating LinqConnect for my company to use in moving an old project to .net core. I'm getting an error on this query
from u in db.user
where u.Created.Value.AddHours(-4) > date.Date
select u.ID
The error is "Line 3: Length or precision specification 0 is invalid."
I ran SQL Server Profiler to capture the SQL being run. It's
exec sp_executesql N'SELECT [t1].[ID]
FROM dbo.[user] [t1]
WHERE DATEADD(ms, (CAST(CONVERT(Float(0,0),@p0 * 3600000) AS Int)) % 86400000, DATEADD(day, (CAST(CONVERT(Float(0,0),@p0 * 3600000) AS Int)) / 86400000, [t1].[Created])) > @p1',N'@p0 float,@p1 datetime',@p0=-4,@p1='2020-07-31 18:18:50.047'
Float(0,0) isn't valid SQL Server syntax, so that's causing the above error. Is this expected behavior, a known error, or is something configured wrong?
from u in db.user
where u.Created.Value.AddHours(-4) > date.Date
select u.ID
The error is "Line 3: Length or precision specification 0 is invalid."
I ran SQL Server Profiler to capture the SQL being run. It's
exec sp_executesql N'SELECT [t1].[ID]
FROM dbo.[user] [t1]
WHERE DATEADD(ms, (CAST(CONVERT(Float(0,0),@p0 * 3600000) AS Int)) % 86400000, DATEADD(day, (CAST(CONVERT(Float(0,0),@p0 * 3600000) AS Int)) / 86400000, [t1].[Created])) > @p1',N'@p0 float,@p1 datetime',@p0=-4,@p1='2020-07-31 18:18:50.047'
Float(0,0) isn't valid SQL Server syntax, so that's causing the above error. Is this expected behavior, a known error, or is something configured wrong?