I have a view which has started causing the following error:
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'R1500051' to data type int.
The problem is, the query is quite big and complex (several sub queries, joins and function calls) and I have no idea where that error is actually coming from. I've tried commenting bits out but that doesn't really help very much (think the error may be coming in more than one place)
It would really help if I could see exactly what was being executed at the time this error was thrown, e.g. if it's a function that's causing the error.
If anyone has any advice about that it would be really useful.