Actually, the best server side scripting for MS environment is Active Server Pages (ASP). With this ASP, you can utilize Windows internal connection among its components using COM.
You can use ADODB component to meet your needs. For practical example, you can go to www.asptoday.com.
If you intend to use PHP instead, there is PHP for Windows version which includes php_MSSQL.DLL (in PHP3), that is library for accessing MSSQL Server. Just try it