views:

1158

answers:

2

I have on my local PC installed WAMP environment (using WampServer OS). Now I would need to change one script from working with MySQL to MSSQL. I have no idea at all how to proceed, where to download MSSQL, how to install it and how to connect with PHP? Thank you very much

+3  A: 
Csaba Kétszeri
+3  A: 

Start by getting Sql Server working. If you are using an old copy of Sql Server (pre 2005) you will need to make sure ntwdblib.dll is present in your System32 directory, and removed from your PHP dll directory (ntwdblib.dll is installed with the enterprise tools, so you may have to install them on your PHP box as well). Once you have Mssql querying properly, start finding where Mssql differs from MySql in your code.

A couple of tips:

  1. The ntwdblib doesn't accept long strings (I think it is limited to 4k, but don't quote me on that). You have to use Stored Procs if you are trying to process a string longer than 4k.
  2. Try to use Sql Server 2005 if you can (see above), the ntwdblib.dll is ancient and has numerous issues.
  3. The PHP site is your friend for mssql.
Kris Erickson