In the following code snippet we show you how to randomize the result set on the SQL Server. In many cases you may wish to randomly return a set records. For example, in one application we wanted to return five records, but have them returned in a random pattern for a banner ad application on a Webs
Tag: sql server
FIX: Restoring transaction log files takes longer than expected in SQL Server 2000
It takes more time than expected to restore the transaction log files in SQL Server 2000. The transaction log restore operation may take 100 times longer or more than a typical restore operation. For example, you may experience that a 100 MB transaction log file now takes 20 minutes to be restored i
Detecting The State of a SQL Server Agent Job
(Gregory A. Larsen) How do you determine if a SQL Server Agent Job is running? Is there a way to automate the process of determining if a SQL Server Agent job is running? What automated approach is there to determine what step is being processed for a given SQL Server Agent job? Is there an easy way
Use Extended Properties to Synchronize Your Documentation, Database Objects, and Code
(Drew Georgopulos) Of the many challenges in creating, distributing, and obtaining consensus for documentation, I find the chief challenge is keeping the statements in the documentation synchronized with changing business conditions, conditions that change due to competitive forces (sales and acquis
The SQL Server Best Practices Analyzer
(Steven Warren) Do you not have a full-time DBA to keep Microsoft SQL Server databases running according to industry standards and best practices? Sometimes even DBAs want to test their SQL Servers against various best practices. In the past, you would have to tweak your SQL Server settings manually
Auditing Through Triggers
(Robert Marda) In this article I will give code examples for a few triggers. For an excellent explanation about triggers in general and how they work in SQL Server 7.0 and SQL Server 2000 please see the following articles written by Brian Kelley: Triggers in SQL Server 7.0 and 2000 – The Common Grou
FIX: Section names are truncated to a total length of 254 characters when you use Data Transformation Services to create a Dynamic Properties task and you add an .ini file in SQL Server 2000
In Microsoft SQL Server 2000, when you use Data Transformation Services (DTS) to create a Dynamic Properties task and you add an .ini file that contains more than 254 characters in section names, the section names are truncated to a total length of 254 characters. Therefore, one of the section names
Obtain Different Portions of a SQL Datetime Field
(Hani Greiss) SQL has the habit of displaying date fields as: yyyy-mm-dd 00:00:00.000. But sometimes, you need to display just the Date or just the Time from a date field.
Automatic SQL Tuning using SQL Tuning Advisor
(Sreeram Surapaneni) SQL tuning is one of the challenging tasks faced by Database Administrators. It is an interesting and creative, but at the same time, daunting task. Manual tuning of SQL statements requires through knowledge of how the statements are executed in the background and experience to
Moving A SQL Server Database
(Desirée Harris) A database move can be done a couple different ways, but when the database is updated frequently and the move needs to be completed with minimal downtime and no data loss, it is best to move it by detaching and then reattaching the database on the new server. The database will be of
