/language 1 - english
/language 2 - deutsch
Dieses Blog durchsuchen
Sonntag, 31. Mai 2009
Freitag, 22. Mai 2009
SQL Express Authentication
Enabling SQL Authentication in SqlExpress
Enabling SQL Authentication
STEP1:
You need to enable SQL Authentication on the machine. This is complex in SQLExpress and you need to edit the registry. Copy the following lines of text onto a Notepad and save it with extention .REG.
-------------COPY BELOW---------------------------------
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer]
"LoginMode"=dword:00000002
-------------COPY TILL THIS---------------------------------
STEP2: Double Click on the .REG file to change the registry. This change the Authentication Mode to enable SQL Authentication.
STEP3: Restart the SQL Server Express Service or reboot the machine for registry change to take effect.
Next, you need to add a user with SQLLogin. To do this: Login to SQLExpress using Express Manager and run the script below:
-------------------------------------------
USE MASTER
exec sp_addLogin 'appuser', 'password123'
GO
exec sp_addsrvrolemember 'appuser', 'sysadmin'
GO
USE db
EXEC sp_adduser 'appuser'
-------------------------------------------
In case you want to reduce the privilege for the user then you can specify something other than sysadmin, but we can think of that once this works.
Now change your connection string as follows:
connectionString = "server=.\\SQLExpress;uid=aspuser;pwd=aspuser@123;database=cartridge;";
Enabling SQL Authentication
STEP1:
You need to enable SQL Authentication on the machine. This is complex in SQLExpress and you need to edit the registry. Copy the following lines of text onto a Notepad and save it with extention .REG.
-------------COPY BELOW---------------------------------
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer]
"LoginMode"=dword:00000002
-------------COPY TILL THIS---------------------------------
STEP2: Double Click on the .REG file to change the registry. This change the Authentication Mode to enable SQL Authentication.
STEP3: Restart the SQL Server Express Service or reboot the machine for registry change to take effect.
Next, you need to add a user with SQLLogin. To do this: Login to SQLExpress using Express Manager and run the script below:
-------------------------------------------
USE MASTER
exec sp_addLogin 'appuser', 'password123'
GO
exec sp_addsrvrolemember 'appuser', 'sysadmin'
GO
USE db
EXEC sp_adduser 'appuser'
-------------------------------------------
In case you want to reduce the privilege for the user then you can specify something other than sysadmin, but we can think of that once this works.
Now change your connection string as follows:
connectionString = "server=.\\SQLExpress;uid=aspuser;pwd=aspuser@123;database=cartridge;";
Abonnieren
Posts (Atom)