|
-
Mar 30th, 2006, 06:01 AM
#1
Thread Starter
Hyperactive Member
How to kick everyone off SQL server
Hi,
How do I disable all remote connections to SQL server, but keep the local connection working.
-
Mar 30th, 2006, 06:16 AM
#2
Re: How to kick everyone off SQL server
By the local connection you mean like your connection while in enterprize manager?
If you mean remotely connected servers to your server then clear the Allow other SQL Servers to connect remotely to this SQL Server using RPC check box.
Last edited by RobDog888; Mar 30th, 2006 at 06:22 AM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 30th, 2006, 06:25 AM
#3
Thread Starter
Hyperactive Member
Re: How to kick everyone off SQL server
Sorry wasn't very clear at all.
I'm physically sat on the server (well not literally, as that would be silly) and for example I want to restore a backup copy of the database. To do this I want to remove all other connections bar my own, is there an easy way to do this? And then stop new connections being made.
-
Mar 30th, 2006, 06:27 AM
#4
Re: How to kick everyone off SQL server
Yes, there is but I dont have access to the Enterprize Manager interface right now as my host doesnt allow me admin permissions in it. 
Perhaps a quick search at MS will turn up a KB Article. 
Sorry, I too wish I had Admin access right know and I could find out easily.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 30th, 2006, 06:58 AM
#5
Re: How to kick everyone off SQL server
Did you try looking at sp_configure procedure. There are two options that might help you user connections and remote access, although I have never tried this myself.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 30th, 2006, 07:00 AM
#6
Re: How to kick everyone off SQL server
I came across that sp too but I know there is a easy way in EM to do it.
Do you have access to EM currently?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 30th, 2006, 07:11 AM
#7
Re: How to kick everyone off SQL server
In EM, right click on the Server, select properties. IN the resulting dialog select Connections tab and in the bottom of the dialog ucheck "Allow other SQL Servers to connect remotely to this SQL Server using RPC".
@Rob: Is this what you are looking for?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 30th, 2006, 07:14 AM
#8
Re: How to kick everyone off SQL server
Almost. That prevents other SQL servers from connecting but he needs to prevent and disconnect other connections to his db except for himself.
So if an app is connected he wants it to disconnect so he can make a backup. Although an online backup is ok to perform depending on the user load.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 30th, 2006, 08:33 AM
#9
Re: How to kick everyone off SQL server
If you are looking to not allow other users in the DB then
Right click on the DB in EM - select properties - go to the OPTIONS tab and
"restrict access" - you have two choices - Members of dbo... or Single User.
But I'm concerned about what you want to do - RESTORE a DB? Are you going to RESTORE a .BAK into an existing DB or drop the DB and restore the .BAK to make a new DB?
-
Mar 30th, 2006, 09:32 AM
#10
Re: How to kick everyone off SQL server
I think I found it.... but it's not easy....
From EM, expand the following nodes:
_Your_Server_ -> Management -> Current Activity.
Click Current Activity, then right click on each of the current processes that are in your database and "Kill Process" ... however.... it's a dangerous thing to do. We do this alot around here and just find it easier to ask everyone to get out of the pool (so to speak) and then do the restore.
-tg
-
Mar 31st, 2006, 06:36 AM
#11
Thread Starter
Hyperactive Member
Re: How to kick everyone off SQL server
The database restore was more of an example.
The scenario is I tell everyone to get of the database for the next 10 minutes. But during this 10 minutes some numpty will try and gain a connection which I don't want, so short of unplugging the network cable how do I stop this.
-
Mar 31st, 2006, 06:49 AM
#12
Re: How to kick everyone off SQL server
We put that control into our app from the start. It looks at a configuration table and can tell the users that the system is turned off at the moment or that the client app version level has changed - and they need the new version to continue.
Are you talking about a single client app at this point?
-
Apr 5th, 2006, 04:32 AM
#13
Member
Re: How to kick everyone off SQL server
Hi
Open the enterprise manager. Go to the properties dialog for the database. Select Restrict access/single user.
Now take the database offline (right click the database and you will get this option). This will force a checkpoint, keeping the integrity of your data. No users will lose data (as they may do if you do something drastic such as pulling out the network cable).
Bring it back online. Back it up (or whatever else you need to do). Now uncheck the Restrict access option.
Hope this helps
-
Apr 5th, 2006, 05:15 AM
#14
Re: How to kick everyone off SQL server
 Originally Posted by Oliver1
Hi,
How do I disable all remote connections to SQL server, but keep the local connection working.
Execute the following TSQL
Code:
ALTER DATABASE NAME_OF_DB_HERE SET SINGLE_USER WITH ROLLBACK
-
Apr 5th, 2006, 05:24 AM
#15
Re: How to kick everyone off SQL server
Take the server off the network.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|