Showing posts with label explain. Show all posts
Showing posts with label explain. Show all posts

Friday, March 30, 2012

Network I/O error in SQL 2000 with SP4 ?

Can anyone explain this NETWORK I/O error I received using SP4, SQL 2K.
"spid85 Process ID 90 killed by hostname tester, host process ID 23328"It would seem that a user by the name of "tester" issued a KILL command for
your connection. Virtual homicide? Nah... Look up KILL in Books Online.
ML
http://milambda.blogspot.com/sql

Friday, March 23, 2012

Nested Transactions - what for?

Hi
Can someone explain what nested transactions can be used for? I know about
the outer an inner transaction but you still either commit or rollback all
transactions.
In Oracle you can start autonomous transaction within another transaction
and any commit or rollback statement affects its own transaction.
So - I am not looking at explanation how to create nested transactions but
what could be a practical use of them?I think that this is largely a leftover from the original Sybase design.
As you know, there are no nested transactions in SQL Server, semantically speaking.
Why did they put in the syntax then? I guess you had to be in that Sybase design meeting to be able
to answer that question. My guess is that it allow for code modules to call each other. One stored
proc programmer want to transaction-protect the code. The proc he is writing will call another proc
which is also transaction-protected. Stuff like that...
Note that savepoint is another matter. This gives the ability to perform partial rollbacks. This is
IMO much more useful then doing partial commits. I find the thought of a partial commit a bit scary,
but perhaps this is because the feature isn't available in SQL Server.
One scenario I would consider it useful, though, is when you want to log actions even if you
rollback the transaction. In SQL Server 2000, we can often achieve the same functionality logging to
a table variable (which survives a ROLLBACK).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Witold" <witoldi@.shaw.ca> wrote in message news:bWo8d.211357$%S.80172@.pd7tw2no...
> Hi
> Can someone explain what nested transactions can be used for? I know about
> the outer an inner transaction but you still either commit or rollback all
> transactions.
> In Oracle you can start autonomous transaction within another transaction
> and any commit or rollback statement affects its own transaction.
> So - I am not looking at explanation how to create nested transactions but
> what could be a practical use of them?
>

Nested Transactions - what for?

Hi
Can someone explain what nested transactions can be used for? I know about
the outer an inner transaction but you still either commit or rollback all
transactions.
In Oracle you can start autonomous transaction within another transaction
and any commit or rollback statement affects its own transaction.
So - I am not looking at explanation how to create nested transactions but
what could be a practical use of them?
I think that this is largely a leftover from the original Sybase design.
As you know, there are no nested transactions in SQL Server, semantically speaking.
Why did they put in the syntax then? I guess you had to be in that Sybase design meeting to be able
to answer that question. My guess is that it allow for code modules to call each other. One stored
proc programmer want to transaction-protect the code. The proc he is writing will call another proc
which is also transaction-protected. Stuff like that...
Note that savepoint is another matter. This gives the ability to perform partial rollbacks. This is
IMO much more useful then doing partial commits. I find the thought of a partial commit a bit scary,
but perhaps this is because the feature isn't available in SQL Server.
One scenario I would consider it useful, though, is when you want to log actions even if you
rollback the transaction. In SQL Server 2000, we can often achieve the same functionality logging to
a table variable (which survives a ROLLBACK).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Witold" <witoldi@.shaw.ca> wrote in message news:bWo8d.211357$%S.80172@.pd7tw2no...
> Hi
> Can someone explain what nested transactions can be used for? I know about
> the outer an inner transaction but you still either commit or rollback all
> transactions.
> In Oracle you can start autonomous transaction within another transaction
> and any commit or rollback statement affects its own transaction.
> So - I am not looking at explanation how to create nested transactions but
> what could be a practical use of them?
>
sql

Friday, March 9, 2012

Negative values for RowModCtr col in sysobjects tbl

Could anyone, please, explain to me why I have negative values in
RowModCtr column in sysobjects table? I have tested that after I update
statistics the RowModCtr column is reset to 0. But why do I have
negative values in the first place? Thx."luke" <svatik@.hotmail.com> wrote in message
news:1116361464.490333.196030@.g49g2000cwa.googlegr oups.com...
> Could anyone, please, explain to me why I have negative values in
> RowModCtr column in sysobjects table? I have tested that after I update
> statistics the RowModCtr column is reset to 0. But why do I have
> negative values in the first place? Thx.

No idea; and I guess you mean sysindexes, not sysobjects? But Books Online
says that the value should be correct since the last time the statistics
were updated (see "sysindexes"), so you might want to look at
"sp_updatestats" and "update statistics". See also p.848 of "Inside SQL
Server 2000", which mentions rowmodctr, and says that when you update
statistics, it's set to zero.

If this doesn't help, I suggest you give some more details - what version of
MSSQL, why the sysindexes value is a problem for you etc.

Simon|||I too have seen negative numbers in the sysindexes table. After reasearching I found:

There is one row in SYSINDEXES for each index and statistics set (if the table does not have a clustered index then there is a row corresponding to the heap as well), and SQL Server 2000 maintains the amount of change for indexes and statistics separately (although this was not true in SQL Server 7.0). Throughout the INSERT, UPDATE, and DELETE queries performed in a table, the rowmodctr value is increased only for the index ID 0 or 1 (there is always only one on a table). For the rest of the indexes and statistics, it shows only a relative value that has to be added to the rowmodctr of the index 0 or 1 to get the true number of changed rows for this index.

For examples and more info go to the following site, the info is near the bottom of the article :)
http://msdn.microsoft.com/library/d...l/statquery.asp