<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Eduzine© - SQL Server</title>
    <link>http://eduzine.edujini-labs.com/</link>
    <description>Articles from Edujini Team</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:" />
    <generator>Serendipity 0.8.2 - http://www.s9y.org/</generator>
    <pubDate>Tue, 06 May 2008 06:19:21 GMT</pubDate>

    <image>
        <url>http://www.edujini-labs.com/images/newmasthead.gif</url>
        <title>RSS: Eduzine© - SQL Server - Articles from Edujini Team</title>
        <link>http://eduzine.edujini-labs.com/</link>
        <width></width>
        <height></height>
    </image>
<item>
    <title>HOWTO: Configure Microsoft SQL Server for Mixed Mode Authentication</title>
    <link>http://eduzine.edujini-labs.com/archives/24-HOWTO-Configure-Microsoft-SQL-Server-for-Mixed-Mode-Authentication.html</link>
<category>SQL Server</category>    <comments>http://eduzine.edujini-labs.com/archives/24-HOWTO-Configure-Microsoft-SQL-Server-for-Mixed-Mode-Authentication.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=24</wfw:comment>
    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;
At times, Windows Authentication in Microsoft SQL Server is not enough. One of the requirements is in ASP.Net as
described in the FAQ &lt;a href=&quot;http://faqs.edujini-labs.com/5_2_en.html&quot;&gt;here&lt;/a&gt;.
This article descibes how to setup mixed mode authentication, also known as SQL Authentication, in Microsoft SQL Server 2000, 2005 and 2005 Express Edition.
&lt;/p&gt;

&lt;p&gt;
Now of course, the need does not arise if the care is taken during installation of SQL Server 2000 and 2005. But for
SQL Server 2005, it becomes mandatory. We explore all versions anyway.
&lt;/p&gt;

 
&lt;h2&gt;Mixed Mode Authentication for SQL Server 2000&lt;/h2&gt;

&lt;p&gt;
Launch Enterprise Manager for SQL Server 2000. Browse to the server node that you are interested in as shown below.
&lt;/p&gt;

&lt;img border=&quot;0&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/mstech/1_mma_2000_01.jpg&quot; /&gt;

&lt;p&gt;
Right click and select the option &lt;code&gt;Properties&lt;/code&gt; or from the &lt;code&gt;Action&lt;/code&gt; menu, select &lt;code&gt;Properties&lt;/code&gt;.
&lt;/p&gt;
&lt;div align=&quot;right&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/mstech/1_mma_2000_02.jpg&quot; /&gt;

&lt;/div&gt;&lt;p&gt;
Go to the &lt;code&gt;Security&lt;/code&gt; tab and select &lt;code&gt;SQL Server and Windows&lt;/code&gt; option for &lt;code&gt;Authentication&lt;/code&gt;.
&lt;/p&gt;
&lt;img border=&quot;0&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/mstech/1_mma_2000_03.jpg&quot; /&gt;

&lt;p&gt;
You may need to restart the server.
&lt;/p&gt;

&lt;h2&gt;Mixed Mode Authentication for SQL Server 2005 Express Edition&lt;/h2&gt;

&lt;p&gt;
For SQL Server 2005 Express Edition, there is not GUI tool available to configure the server. You need to go it manually.
The first step is to change the login-mode.
&lt;/p&gt;

&lt;p&gt;
Open registry editor (launch application &lt;code&gt;%WINDIR%\regedit.exe&lt;/code&gt;) and go to
&lt;code&gt;HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer&lt;/code&gt; in the tree on the left.
&lt;/p&gt;

&lt;p&gt;
On the right, look for an entry named &lt;code&gt;LoginMode. The default value, when installed is &lt;code&gt;1&lt;/code&gt;.
Update it to &lt;code&gt;2&lt;/code&gt;. The next step is to restart the service.
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;
Launch your Service Manager (&lt;code&gt;Start -&amp;gt; Run -&amp;gt; Type services.msc&lt;/code&gt;)
and look for a service named &lt;code&gt;MSSQL Server (SQLEXPRESS)&lt;/code&gt;. Restart the service.
&lt;/p&gt;

&lt;p&gt;
Hey! We are not done  yet... at least practically. We need to add a user with administrative priviledges
so that the database can be accessed from ASP.Net.
&lt;br /&gt;
On the command prompt, login to SQL Server command prompt using the &lt;code&gt;osql&lt;/code&gt; utility. SQL Server 2005
Express Edition is installed with the instance name &lt;code&gt;SQLEXPRESS&lt;/code&gt;. Use the following command to login:
&lt;/p&gt;
&lt;pre&gt;osql -E -S .\SQLEXPRESS&lt;/pre&gt;

&lt;p&gt;
One the SQL-command prompt, execute the following?
&lt;/p&gt;

&lt;pre&gt;1&amp;gt; exec sp_addlogin 'username', 'password'&lt;br /&gt;2&amp;gt; go&lt;br /&gt;1&amp;gt; exec sp_addsrvrolemember 'username', 'sysadmin'&lt;br /&gt;2&amp;gt; go&lt;br /&gt;1&amp;gt; quit&lt;/pre&gt;

&lt;p&gt;
Replace the &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt; but not forget the quotes.
To verify, try login using the following on the command prompt:
&lt;/p&gt;

&lt;pre&gt;osql -S .\SQLExpress -U username&lt;/pre&gt;

&lt;p&gt;
Provide the password when asked for and you should be through!
&lt;/p&gt;

&lt;h2&gt;Mixed Mode Authentication for SQL Server 2000&lt;/h2&gt;

&lt;p&gt;
Launch SQL Server Management Studio. Connect using Windows Authentication. Ensure that you are logged in
as with administrative privileges. On the machine node in &lt;code&gt;Object Explorer&lt;/code&gt;,
right click and select option &lt;code&gt;Properties&lt;/code&gt;.
&lt;/p&gt;

&lt;img border=&quot;0&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/mstech/1_mma_2005_01.jpg&quot; /&gt;

&lt;p&gt;
Go to the &lt;code&gt;Security&lt;/code&gt; page and select &lt;code&gt;SQL Server and Windows Authentication Mode&lt;/code&gt;
for the &lt;code&gt;Server Authentication&lt;/code&gt;.
&lt;/p&gt;

&lt;img border=&quot;0&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/mstech/1_mma_2005_01.jpg&quot; /&gt;

&lt;p&gt;
You may need to restart the server.
&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;
For Microsoft SQL Server 2000 and 2005, having initial wrong choice for authentication is, now, not a burden.
Also, for Microsoft SQL Server 2005 Express Edition, it is easy to configure it for the mixed mode
authentication and create new IDs.
&lt;/p&gt;
    </content:encoded>
    <pubDate>Sun, 01 Apr 2007 00:59:42 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/24-guid.html</guid>
    </item>
</channel>
</rss>
