Alter Database options

  • How would you, after a database is created, change some of the options i.e. specify different percentage of file growth?

    Regards

  • I know that with new databases you use the .ADD method. Is there a .ALTER method or something simmilar?

  • You have to dig a little. For example, there is a dboption object that roughly corresponds so the sp_dboption proc. For file growth, you have to dig down through filesgroups to get to the DBFile object.

    Andy

    http://qa.sqlservercentral.com/columnists/awarren/

  • Hi Andy,

    Thanx for the advice. This is what I am currently doing.

    I 'dim' the following objects Database, TransactionLog, FileGroups, FileGroup, DBFile & LogFile as SQLDMO objects.

    I 'Set' the following objects: oDatabase as the current selected database, oTransactionLog as oDatabase.TransactionLog, oFileGroups as oDatabase.filegroups.

    What happens then is that the selected database's options and TransLog & DBFile options are displayed.

    If I want to change the transactionlog maxsize, I can do it from this screen, but the problem now is how to update the changes to the logfile with DMO?

    Hope this is clear 😉

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply