Turning transaction log on off and on with

  • Is there a way to turn the transaction logging off in T-SQL stored procedure and then turn it back on, after the transaction is complete? I have a stored proc that has several nested cursors inside of it, which seems to overfills the log file. Thanks in advance.

  • You can, but it required modifying the database using the 'alter database' command which you don't just give to anyone (espically on a production server!).

    Also remember after setting the recovery model back to 'full' you will need a full backup, otherwise your translaction logs will not be usuable.

    e.g.

    alter database pubs set RECOVERY FULL

    alter database pubs set RECOVERY SIMPLE

    Perhaps it would be better to look at rewriting your query.

    Steven

Viewing 2 posts - 1 through 1 (of 1 total)

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