I have one (or can be more) database on the sql server 7.0 and i want it to be accesible only from time 0800-2000.
Is this possible ? Automatically i mean by SQL server??
Thanks
There are a few possibilities using the sp_dboption system stored procedure.
Make the database unavailable to any user except the owner.
USE master
EXEC sp_dboption 'dbname', 'dbo use only', 'TRUE'
Take the database offline - no user can access it.
USE master
EXEC sp_dboption 'dbname', 'offline', 'TRUE'
Make the database read-only.
USE master
EXEC sp_dboption 'dbname', 'read only', 'TRUE'
You could create a scheduled Job that would run at 2000 and execute sp_dboption to set one of the options mentioned to TRUE. Another Job could run at 0800 to set the selected option to FALSE. Terry
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.