FilChi Weblog

Archive for the ‘MSSQL’ Category

I was debugging this SQL statement in MSSQL and it says

“Syntax error converting the varchar value ‘LDI ‘ to a column of data type int. ”

I realized that this was due to the part where in the “Where” clause that compares the value of a char column with an integer, like for example,

agent_code = 942,

when it should be

agent_code = '942'


where in mysql,
I could just compare the column with a value regardless of its type.
It could be already a known common difference between MSSQL and MySQL when comparing column values of different types, but I guess I just have to blog about it.

Flickr Photos