Have you read follow the instructions in the Moodle Website
Here it is:
Installation overview
1) Get MSSQL Server installed and running. (A free limited version, SQL Server Express Edition is available for testing.)
Make sure that you choose mixed authentication (Windows and local accounts) to keep things simpler later. You'll be asked to define the "sa" account password (it's the default System Administrator account which has full access to all databases by default).
2) Make sure MS SQL Server can accept incoming TCP/IP connections on port 1433 (the standard one).
You might need to explicitly allow this in your Windows firewall (see the Control Panel). You may also need to edit options in the :SQL Server Configuration Manager -> Network Configuration -> Protocols -> TCP/IP enabled
3) Open the "SQL Server Management Studio" and create a new empty database. If you are using the "sa" account then you don't need to do anything else here.
4) Configure these settings in your created (and still empty) database: Configure these settings in your created (and still empty) database:
Use a case sensitive collation, such as Latin1_General_CS_AS.
ANSI NULLS Enabled = true (ALTER DATABASE xxxx SET ANSI_NULLS ON)
Quoted Identifiers Enabled = true (ALTER DATABASE xxxx SET QUOTED_IDENTIFIER ON)
(Moodle 2.x only) Row Versioning Enabled (ALTER DATABASE xxxx SET READ_COMMITTED_SNAPSHOT ON)
This is not settable via the DB properties. To set READ_COMMITTED_SNAPSHOT, there must be no active connections to the database except for the connection executing the ALTER command. If you are viewing the DB in the Server Management Studio, disconnect from any servers in the "Object Explorer" (right-click > Disconnect), then create a "New Query" and run the ALTER command. See http://msdn.microsoft.com/en-us/library/bb522682.aspx for details.
If your DB name starts with a number, you may need to put quotes around the DB name in the query.
5) Get PHP installed with a web server. Unless you want to do it under IIS or some other way, the packages on the Moodle download page are a good solution.
6) Choose one of the following specific sections for your server to install the mssql extension alternative installed and running properly on your PHP box.
7) Set the following settings in your php.ini file
mssql.textlimit = 20971520
mssql.textsize = 20971520
8) With all this properly configured, you can continue with a standard Moodle installation.