-
how find out if db is readonly or dbo use only with sql
Hi,
I have sciprt that assign object
permissions to all databases.
I want to exclude all read only and dbo use only databases
Thank you
Alex
-
Run 'sp_dboption db_name'.
-
select Status=
CASE Status&1024 WHEN 1024 THEN 'Read Only ' +char(13)+char(10) ELSE '' END+
CASE Status&2048 WHEN 2048 THEN ' DBO Use only ' +char(13)+char(10) ELSE '' END
from sysdatabases
-
thank a lot for both solutions
but what is Status&1024 ?
Alex
-
It performs a bitwise logical AND operation between two integer values.
-
one more question
I have maintenance plan to reorganize all db , any way to make it run for all db except read only
thank you
-
I am afraid you have to select databases manually
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
|
|