The below query is causing too much wait time.
(@P0 bigint,@P1 bigint,@P2 bigint,@P3 bigint,@P4 varchar(4000))
select * from USER_TRACKED_EVENT where (USER_TRACKED_ID= @P0 AND USER_EVENT_TYPE_ID= @P1 )
OR (USER_TRACKED_ID= @P2 AND USER_EVENT_TYPE_ID= @P3 AND VALUE1= @P4 )
In case of Datatype mismatch, is it best option to convert @p4 or should we convert "VALUE1" column in USER_TRACKED_EVENT table .
The datatype of "VALUE1" is varchar (32).
I think it is best to convert the temporary variable @p4 but i dont want to miss any data, as if the data exceeds varchar(32) , the remaining will be trimmed.
But if we convert "value1" o varchar(8000), then it will utilize memory.
Please give some suggestion