Re: Setting Database Access




ALTER DATABASE MyDatabase
SET READ_ONLY


ALTER DATABASE MyDatabase
SET READ_WRITE


--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


"PGene2" <PGene2@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6D171FEC-13A3-4362-98FE-EEC20FED8C05@xxxxxxxxxxxxxxxx
I run several DTS Packages that load databases residing on two seperate
instances of SQL Server 2000 on the same server. For security reasons, I
need to be able to set the Databases on one instance to Read/Write access,
set the database access on the other instance to Read only, run the
packages
on the first instance, and then reset the access to Read Only. The ideal
solution would be writing the logic in T-SQL in a stored procedure that is
already part of the Package or add a new stored procedure to the package.
I
have not been able to find any reference to setting the Database access in
code. I would appreciate and welcome any advise on how to accomplish this
programming task. Thank you.

--
grp


.



Relevant Pages

  • Re: How to close all connections to do backup programmatically?
    ... ALTER DATABASE MyDatabase ... one does not normally quiesce the database to perform backups. ... Transact-SQL BACKUP DATABASE command will guarantee transactional integrity, ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: How to close all concurrent connections to a database?
    ... ALTER DATABASE MyDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE ... and after the task u can set the database to multi user ... > I'm wondering how to detect and close all concurent connection to a> database in SQL Server 2000. ...
    (microsoft.public.sqlserver.connect)