if you want to do a simple error handling just use on error event handler and add a script task there and do your appropriate action.
but if you want to do deeper consideration on exact error descriptions in dataflow tasks you can use some articles like below:
http://www.sqlservercentral.com/articles/Integration+Services+%28SSIS%29/62662/
and about syntax in sql statement, just use sql syntax which you used in your dbms,
I think if you want more deeper help, you must explain what you want to do exactly in this package.
Regards,