Bru Medishetty's SeekWell Blogs
Archive for March, 2010
Find Transaction Log Space Used
Mar 31st
To query the space used by the transaction logs use the command, use DBCC SQLPERF(LOGSPACE). The command displays the Database Name, Log Size in Mega Bytes, the % of log file used, remember the value is not the size it is the percentage used from the actual space of the log files. The results displayed is for all databases on the SQL Server instance.
Find the script below…
DBCC SQLPERF(LOGSPACE)
Monitoring transaction log files for the free space is a one of the very important tasks for a DBA.
– Bru Medishetty
WAITFOR Clause
Mar 28th
When writing T-SQL Statements, the usage of WAITFOR clause will cause a delay in the execution of the subsequent statements until the condition is met.
WAITFOR clause can be used along with Time or Delay. Let us look at them with an example.
WAITFOR DELAY
When WAITFOR DELAY is used a delay duration needs to be mentioned which is of the format HH:MM:SS format followed by one thousandth of a second’s value. In the following image the Delay value mentioned is 5 seconds, hence the execution of the next statement i.e GETDATE() is delayed for 5 seconds. Find the T-SQL code used in the example below…
SELECT GETDATE()
WAITFOR DELAY '00:00:05:000'
SELECT GETDATE()
WAITFOR TIME
When WAITFOR TIME is used, a time value needs to be mentioned which is of the format HH:MM:SS format followed by one thousandth of a second’s value. In the following image the time value mentioned is 09:11:05 AM, hence the execution of the next statement i.e GETDATE() is delayed till that time occurs. Remember that the Time value is a 24 hour format of time. Find the T-SQL code used in the example below…
SELECT GETDATE()
WAITFOR TIME '09:11:05:000'
SELECT GETDATE()
Administer SQL Server Services Remotely using Services Console
Mar 25th
This is an article that was published yesterday in MSSQLTips. The article describes the steps to perform few Administration tasks related to SQL Server from Services Management Console. Read the complete article on MSSQLTips site here http://www.mssqltips.com/tip.asp?tip=1969&home


Recent Comments