Click here to Skip to main content
13,198,075 members (92,884 online)
Click here to Skip to main content
Add your own
alternative version

Stats

3K views
Posted 22 Aug 2017

Enabling SQL Express User

, 22 Aug 2017
Rate this:
Please Sign up or sign in to vote.
How to enable SQL Express user

Visual Studio(VS) lovers! Yes, we want to work on everything from within the VS. Yes, of course, our VS have required features to support us to perform various development and ALM operations. Database is one of the main parts of any application development. Instead of working on the database objects using SQL Server Management Studio, we prefer to use VS. Access the database directly from VS using the SQL Server Object Explorer. Moreover, we would like to work with the SQL express instead of connecting to a centralized database server for small project or at the starting of a project.

Even though we have Admin access, most of the time, we end up with permission issues in database level. This prevents us from create a database in SQL Express.

If you have Admin privilege in system, we can quickly fix this issue. Go to your services using Start> Run> services.msc. Locate the SQL Server (SQLEXPRESS) service from the list of services.

Right click and select Properties.

Stop the service using the Stop option in the Properties window, if not stopped. Now, enter -m into the Start parameters text box to start the SQL express service in Single used mode.

Start the service using Start option in the Properties window.

Go to command prompt using Start>Run>cmd and run the following commands to add the domain user as a sysadmin to SQL express.

Note: Replace domain\user with the corresponding domain user information before running the following command.

osql -S .\sqlexpress -E
create login [domain\user] from windows
go
exec sp_addsrvrolemember @loginame= ‘domain\user’, @rolename='sysadmin'
go

Once the command execution completes, navigate back to the services window and stop the SQL Express service. Remove -m from Start parameters and start the SQL express service to support multiple users.

Now, we can create a new database using Visual Studio’s SQL Server Object Explorer and perform our database operations.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

ambilykk
Architect TCS
India India
I have over 10 years of experience working on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP.Net, HTML5, jQuery and Ajax. My interests also include TFS, Azure, Windows 8, Visual Studio 2010. Technology adoption and learning is my key strength and technology sharing is my passion.

Microsoft MVP: Connected Service Developer

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralMy vote of 5 Pin
Member 1236439024-Aug-17 21:46
memberMember 1236439024-Aug-17 21:46 
QuestionThoughts Pin
Wendelius23-Aug-17 5:17
mvpWendelius23-Aug-17 5:17 
AnswerRe: Thoughts Pin
ambilykk23-Aug-17 20:10
memberambilykk23-Aug-17 20:10 
GeneralRe: Thoughts Pin
Wendelius24-Aug-17 6:05
mvpWendelius24-Aug-17 6:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171020.1 | Last Updated 23 Aug 2017
Article Copyright 2017 by ambilykk
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid