Showing posts with label connections. Show all posts
Showing posts with label connections. Show all posts

Wednesday, March 21, 2012

how close all current connections to server?

How do you give users/current connections "the boot" in SQL Server (I'm
actually using MSDE2000).
I want to close all current connections to a database (before
deleting/changing it) - is there a way to close all current connections to a
specified database?
thanks in advance,
Rua Haszard Morris.Try
ALTER DATABASE MyDatabase
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
Hope this helps.
Dan Guzman
SQL Server MVP
"Rua Haszard Morris" <RuaHaszardMorris@.discussions.microsoft.com> wrote in
message news:F15B6DB3-5213-4D75-8A37-75E406EEE5B5@.microsoft.com...
> How do you give users/current connections "the boot" in SQL Server (I'm
> actually using MSDE2000).
> I want to close all current connections to a database (before
> deleting/changing it) - is there a way to close all current connections to
> a
> specified database?
> thanks in advance,
> Rua Haszard Morris.

how close all current connections to server?

How do you give users/current connections "the boot" in SQL Server (I'm
actually using MSDE2000).
I want to close all current connections to a database (before
deleting/changing it) - is there a way to close all current connections to a
specified database?
thanks in advance,
Rua Haszard Morris.Try
ALTER DATABASE MyDatabase
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
Hope this helps.
Dan Guzman
SQL Server MVP
"Rua Haszard Morris" <RuaHaszardMorris@.discussions.microsoft.com> wrote in
message news:F15B6DB3-5213-4D75-8A37-75E406EEE5B5@.microsoft.com...
> How do you give users/current connections "the boot" in SQL Server (I'm
> actually using MSDE2000).
> I want to close all current connections to a database (before
> deleting/changing it) - is there a way to close all current connections to
> a
> specified database?
> thanks in advance,
> Rua Haszard Morris.

how close all current connections to server?

How do you give users/current connections "the boot" in SQL Server (I'm
actually using MSDE2000).
I want to close all current connections to a database (before
deleting/changing it) - is there a way to close all current connections to a
specified database?
thanks in advance,
Rua Haszard Morris.
Try
ALTER DATABASE MyDatabase
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
Hope this helps.
Dan Guzman
SQL Server MVP
"Rua Haszard Morris" <RuaHaszardMorris@.discussions.microsoft.com> wrote in
message news:F15B6DB3-5213-4D75-8A37-75E406EEE5B5@.microsoft.com...
> How do you give users/current connections "the boot" in SQL Server (I'm
> actually using MSDE2000).
> I want to close all current connections to a database (before
> deleting/changing it) - is there a way to close all current connections to
> a
> specified database?
> thanks in advance,
> Rua Haszard Morris.

Monday, March 19, 2012

How can you enable remote connections using TSQL?

I know how to enable remote connections using the Surface Area Configuration tool.
Seems there would also be a way to configure it using a TSQL command/procedure call.
thanks,
- Paul -
You can use sp_configure to enable the features exposed by Surface Area Configuration tool. To see the options, run following first:
exec sp_configure 'show advanced options', 1;
reconfigure with override;
Please take a look at topic below in Books Online for more details.
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/scsql9/html/f741169c-1453-4ad2-830b-bf2be27d712f.htm
For remote connections, you have to use SMO to do it. Doing it from TSQL directly is not possible since it requires manipulation of registry values and please don't use the undocumented XPs for registry manipulation.