Review this thread.
(Well I was going to add a link here but I can't figure out how to do it and time is short. But search for mssql and you will find many related thread)
The whole notion of escaping (with slashes) is a non-standard extension of sql that mysql and postgresql support.
"Real" sql (like MSsql) requires that you "double up" single quotes when inserting. Something like
$data = str_replace("'","''",$data);
$sql = "Insert into table values ('$data')";
Read the comments in manual on stripslashes and addslashes. This topic is pretty common.
Many sites have a global "majic_quotes" variable set which actually adds unwanted escape characters to data received from html forms. When using MSsql you have to strip these slashes out as well.
It should be pointed out that both mysql and postgresql also support the "real" way of dealing with quotes. So what works on MSsql will also work on mysql.
(Actually, you need to escape the escape character on mysql to store it, not sure about MSsql).
I guess it's just unfortunate that escaping the data in a non-standard way has become common.