|
Home > Archive > MS SQL Server > September 2005 > Database Locking
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| atif.aqeel@gmail.com 2005-09-30, 9:23 am |
| Hi
I have to run EOD i.e End of Day, a VB 6.0 Application(ADO 2.6) with
SQL Server 2000
I want to lock the Database, full/complete Database,
there are more than 100 tables so locking them one by one would not be
the ideal solution(i think)
the requirement is
i - all currently logged in users must automatically logged out
( all open connections should be closed )
ii - all transactions should automatically rolled back
iii - no user can login while EOD is running
solution plz
Regards
| |
| Imtiaz Ullah 2005-09-30, 9:23 am |
| Wow... You could start by looking into Pausing SQL server in BOL?
Immy
<atif.aqeel@gmail.com> wrote in message
news:1128084372.490596.85200@z14g2000cwz.googlegroups.com...
> Hi
>
> I have to run EOD i.e End of Day, a VB 6.0 Application(ADO 2.6) with
> SQL Server 2000
>
> I want to lock the Database, full/complete Database,
> there are more than 100 tables so locking them one by one would not be
> the ideal solution(i think)
>
> the requirement is
> i - all currently logged in users must automatically logged out
> ( all open connections should be closed )
> ii - all transactions should automatically rolled back
> iii - no user can login while EOD is running
>
> solution plz
> Regards
>
| |
| Tibor Karaszi 2005-09-30, 11:23 am |
| I assume you want to do this at the database level, not the SQL Server instance level. If so, use:
USE dbname
ALTER DATABASE dbname SET SINGLE_USER ROLLBACK IMMEDIATE
Do your job, and then set back to MULTI_USER
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/
Blog: http:// solidqualitylearning
.com/blogs/tibor/
<atif.aqeel@gmail.com> wrote in message news:1128084372.490596.85200@z14g2000cwz.googlegroups.com...
> Hi
>
> I have to run EOD i.e End of Day, a VB 6.0 Application(ADO 2.6) with
> SQL Server 2000
>
> I want to lock the Database, full/complete Database,
> there are more than 100 tables so locking them one by one would not be
> the ideal solution(i think)
>
> the requirement is
> i - all currently logged in users must automatically logged out
> ( all open connections should be closed )
> ii - all transactions should automatically rolled back
> iii - no user can login while EOD is running
>
> solution plz
> Regards
>
|
|
|
|
|