Re: SQL Server - do I need PHP to run COMMIT?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using COMMIT is only required if you issued a BEGIN TRANS before your
INSERTs, UPDATEs and / or DELETEs. All transactions are automatically
committed if you don't use BEGIN TRANS.  Are you backing up the
transaction logs regularly?

-- bob

On Fri, 16 Dec 2005, Alex Gemmell wrote:

> Hello people,
>
> My PHP application uses a SQL Server 2000 database.  I have previously
> only ever used MySQL and so my knowledge of SQL Server comes just from
> experimentation and trial and error experience.
>
> My PHP application appears to be working fine but I have just discovered
> that although the database itself is rather small on the disk (about
> 25MB) the transaction log file is huge (400MB).  I have had a quick look
> at Microsoft's website about large transaction files and they suggest
> many reasons, one of which is the application not COMMITing
> transactions.  This is certainly true because I simply make INSERT and
> UPDATE queries but don't include a COMMIT statement.
>
> So my question is this:  should I be COMMITing?
>
> How do I do that?  Do I simply run something like this after every
> INSERT/UPDATE/DELETE:
>
> mssql_query('COMMIT', $link_identifier);
>
> Please help - I feel like I'm missing a trick here.
>
> FYI:  I'm also now doubting my use of "mssql_pconnect()"  - should I
> being using "mssql_connect()" with "mssql_close()" instead?
>
> Thanks,
>
> Alex
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux