all groups > sql server programming > april 2006 >
You're in the

sql server programming

group:

Looking for a method


Looking for a method Enric
4/5/2006 11:26:01 PM
sql server programming:
Dear all,

I'm struggling myself trying to obtain the total number of transactions
commited in a database in a specific period of time, for instance a month.

Using this query you obtain info based in .log file although dates not
appeared:

SELECT Operation, count(*) FROM ::fn_dblog(null,null)
where Operation in ('LOP_BEGIN_XACT', 'LOP_COMMIT_XACT')
group by Operation

Nevertheless when you do a shrink and one database which have simple
recovery model that information is lost so that it's no reliable at all.

We don't want use third-vendor tools.
Thanks for any input or thought,

Please post DDL, DCL and DML statements as well as any error message in
order to understand better your request. It''s hard to provide information
without seeing the code. location: Alicante (ES)
RE: Looking for a method Enric
4/5/2006 11:53:02 PM
hi again,

I'm trying to capture the name of each database by undocumented
sp_msforeachedb
stored procedure but I haven't idea how the hell do it!

CREATE TABLE TOTAL_TRANSACCIONES
(
OPERATION CHAR(20),
TOTAL INT,
BASE_DATOS VARCHAR(40) NULL)

GO
INSERT INTO TOTAL_TRANSACCIONES(OPERATION,TOTAL) EXEC SP_MSFOREACHDB 'USE ?;
SELECT Operation, count(*) FROM ::fn_dblog(null,null)
where Operation in (''LOP_BEGIN_XACT'', ''LOP_COMMIT_XACT'')
group by Operation'
GO

Parameter ? should be return to the table but is it possible?



Thanks for any help,

[quoted text, click to view]
AddThis Social Bookmark Button