Need help with MSSQL Transactions
Posted: Fri Jul 25, 2003 12:49 pm
help. i would like to know whether a transaction is successful or not, what should i do? right now i have something like this:
********************TSQL******************
declare @success int
BEGIN TRAN
...
...
...
IF (@@ERROR<>0) BEGIN
set success=1
COMMIT TRAN
END
select @success as success
*****************************************
$res=mssql_query([that_whole_thing],$db_link)
************************************************
it runs fine when i run it on MSSQL Server but running it from php using mssql_query will execute the transaction, but not the select clause.
mssql_fetch_object($res) returns nothing, same with
mssql_fetch_array($res).
anyone have any ideas?
********************TSQL******************
declare @success int
BEGIN TRAN
...
...
...
IF (@@ERROR<>0) BEGIN
set success=1
COMMIT TRAN
END
select @success as success
*****************************************
$res=mssql_query([that_whole_thing],$db_link)
************************************************
it runs fine when i run it on MSSQL Server but running it from php using mssql_query will execute the transaction, but not the select clause.
mssql_fetch_object($res) returns nothing, same with
mssql_fetch_array($res).
anyone have any ideas?