I have the below query that works fine in non prod env while it throws above error in prod
filecreationdate has VARCHAR(100) datatype and the sample value in the table is 'Dec 19 2013 12:00AM' SELECT
CASE WHEN MSP.filecreationdate NOT LIKE '%T%' THEN CONVERT(INT,CONVERT(VARCHAR,CONVERT(datetime,MSP.filecreationdate),112))
ELSE CONVERT(INT,CONVERT(VARCHAR,CONVERT(datetime,substring(MSP.filecreationdate,1,10)),112)) END
FROM STAGING.dbo.cobenrollxmlMSP MSP