Hi,
here are some additional information. The info on the database options is stored in dbtable structure. If we have a closer look on this we see what is going on. In my example I choose the option "truncate log on checkpoint".
Redirect dbcc output to screen:
1> dbcc traceon(3604)
2> go
DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role.
1> use master
2> go
No option is set for the database called prim.
1> sp_helpdb prim
2> go
name db_size owner dbid created durability lobcomplvl inrowlen status
---------------- ---------------------------------------------------- -------------------- ---------------- ------------------------------------------------ ---------------------------------------- ---------------------------------------- -------------------------------- --------------------------------------------------------
prim 68.0 MB sa 8 Oct 02, 2015 full 0 NULL no options set
Now we run dbcc dbtable and, well, currently we do not see anything as the option is not set; it will be clearer later on:
1> dbcc dbtable (prim)
2> go
ACTIVE DBTABLES:
DB Table at: 0x0x1ae528080
dbt_dbid=8 dbt_stat=0x1 (0x0001 (DBT_TXT_LINKED))
...
< skipped long output >
...
DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role.
Set the option with 1
1> sp_dboption prim, "trunc log on chkpt", true, 1
2> go
Database option 'trunc log on chkpt' turned ON for database 'prim'.
Running CHECKPOINT on database 'prim' for option 'trunc log on chkpt' to take effect.
(return status = 0)
And now dbcc dbtable shows that the option is set (DBT_AUTOTRUNC):
1> dbcc dbtable (prim)
2> go
ACTIVE DBTABLES:
DB Table at: 0x0x1ae528080
dbt_dbid=8 dbt_stat=0x9 (0x0008 (DBT_AUTOTRUNC), 0x0001 (DBT_TXT_LINKED))
...
< skipped long output >
...
Then set the option to "false"
1> sp_dboption prim, "trunc log on chkpt", false
2> go
Database option 'trunc log on chkpt' turned OFF for database 'prim'.
Running CHECKPOINT on database 'prim' for option 'trunc log on chkpt' to take effect.
(return status = 0)
Set the option with 0
1> sp_dboption prim, "trunc log on chkpt", true, 0
2> go
Database option 'trunc log on chkpt' turned ON for database 'prim'.
Run the CHECKPOINT command in the database that was changed.
(return status = 0)
Now dbcc dbtable does not show that the option is set:
1> dbcc dbtable (prim)
2> go
ACTIVE DBTABLES:
DB Table at: 0x0x1ae528080
dbt_dbid=8 dbt_stat=0x1 (0x0001 (DBT_TXT_LINKED))
...
< skipped long output >
...
After switching to the database and running the checkpoint command, the option is set as you can see in dbtable
1> use prim
2> go
1> checkpoint
2> go
1> dbcc dbtable (prim)
2> go
ACTIVE DBTABLES:
DB Table at: 0x0x1ae528080
dbt_dbid=8 dbt_stat=0x9 (0x0008 (DBT_AUTOTRUNC), 0x0001 (DBT_TXT_LINKED))
...
< skipped long output >
...
Best regards,
Juergen