SQL DBA hand tool i.e Database Engine Stored Procedures in SQL Server 2008:-
* DBCC SQLPERF(logspace)
DBCC SQLPERF -logspace – is an absolutely functional command if you are only interested in consumption of your database log files. It provides the cumulative size for each log file for each database on the SQL Server instance as well as the amount of space consumed -as a percentage of total log file size -. A drawback is the fact that the results are an aggregate for the database.
logspace can be 1 of the value below:
UMSStats – SQL thread management
WaitStats – resources, wait types
IOStats – outstanding reads & writes (note: always zeros)
RAStats – read ahead activity (note: always returns zeros)
Threads – I/O / CPU / memory usage per thread
SpinLockStats – statistics on spinlocks
UMSSpinStats – statistics on UMS
NetStats – ODS statistics
LRUStats – LRU-MRU chain statistics (Note: free page scan always zero).
* SQL @@ROWCOUNT
Returns the number of rows affected by the last statement. It will let you to do a checking on the record you updated.
If the number of rows is more than 2 billion, use ROWCOUNT_BIG.
SET JobTitle = ‘Manager’
WHERE UserID = ‘u10021’
IF @@ROWCOUNT = 0
PRINT ‘Warning: No rows were updated’;
Khan – MCTS www.addarr.com