HI There, i have a poorly performing query i want to create a plan guide for. the query includes the line:
(((T8.TRANSDATE>={ts '2022-10-16 00:00:00.000'}))
in my plan guide i changed the line to:
(((T8.TRANSDATE>={ts ''@P1''})
@params = N'@P1 DATETIME2
however when i try to create the plan guide i get the following error:
Msg 241, Level 16, State 3, Line 3
Conversion failed when converting date and/or time from character string.
any idea how can get around this ?
Regards,
Niall
(((T8.TRANSDATE>={ts '2022-10-16 00:00:00.000'}))
in my plan guide i changed the line to:
(((T8.TRANSDATE>={ts ''@P1''})
@params = N'@P1 DATETIME2
however when i try to create the plan guide i get the following error:
Msg 241, Level 16, State 3, Line 3
Conversion failed when converting date and/or time from character string.
any idea how can get around this ?
Regards,
Niall