SQL Server Multiuser

Hi, In VB.Net, How can i open SQL server database in multiuser mode or in single user mode
Thans
ashraf_tAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
if you had read the link above ...
anyhow:
ALTER DATABASE yourdb SET MULTI_USER;
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
ashraf_tAuthor Commented:
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
ashraf_tAuthor Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
do not forget to, afterwards, issue the MULTI_USER option back...
0
 
ashraf_tAuthor Commented:
:) ok where and how i can use thsi MULTI_USER?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.