[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Server Multiuser

Posted on 2007-08-12
7
Medium Priority
?
156 Views
Last Modified: 2010-03-19
Hi, In VB.Net, How can i open SQL server database in multiuser mode or in single user mode
Thans
0
Comment
Question by:ashraf_t
  • 4
  • 3
7 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 19679875
you mean, configure the database to be single user mode or multi user mode?
why do you try to do that, or maybe confuse some concepts?
please explain.
0
 

Author Comment

by:ashraf_t
ID: 19680226
I mean: at some times i want to prevent more than one computer to connect to a specific  database in sql server(for example i want to make some mintenance or fixing some errors)  so how can i do this, in access database for example i was apple to put the statement "multiuser=false" in the connection string, in sql server how can i do this?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 19680259
you cannot do that via the connection string.
you have to set the database into single user mode, which will fail if other users are already connected:
ALTER DATABASE yourdb SET SINGLE_USER;
http://msdn2.microsoft.com/en-us/library/ms174269.aspx
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:ashraf_t
ID: 19680311
Ok no problem i will asume that no one is connected in this moment , another thing even if it fails that is ok and the administrator can told everyone connectd to go out
This is not the big problem
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 19680321
do not forget to, afterwards, issue the MULTI_USER option back...
0
 

Author Comment

by:ashraf_t
ID: 19680346
:) ok where and how i can use thsi MULTI_USER?
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 19680353
if you had read the link above ...
anyhow:
ALTER DATABASE yourdb SET MULTI_USER;
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question