Search 
Wednesday, September 08, 2010 ..:: Home ::.. Register  Login
  

Welcome to SQL Server Examples

The examples on this portal will provide you with the building blocks necessary to quickly resolve different TSQL coding issues.  You can browse the examples by using the Examples link on the main menu. You can also download all the examples on this site by clicking HERE.

Also available on this site is a  SQL Server monitoring tool known as the SQL Server DBA Dashboard tool.  This tool provides both high level and detailed reports to help monitor your SQL Server instances.  With this tool you can quickly identify the resources used by specific TSQL statements and stored procedures. 

The downloadable examples document and the dashboard tool are only available to registered user.

If you are a registered user and would like like to keep up to date on new examples and/or products/versions please subscribe to our newsletter by updating your profile.  

This website is maintained by Gregory A. Larsen. If you would like to see your examples posted on this site, or have questions please Contact Us.


  
 Recent Examples
Getting Output To a File without Column Headings - Saturday, November 22, 2008
This examples shows you how you how to get output from a T-SQL statement into a file without it having column headings.
 read more ...

Obtaining SQL Server Setup Information - Thursday, July 17, 2008
This example obtain SQL Server instance setup information by using a number of select statements.
 read more ...

First Day of the Quarter - Sunday, July 13, 2008
This example calculates the first day of the quarter.
 read more ...

Sequentially Number Records by Using Cursor - Wednesday, July 09, 2008
This example sequentially numbers a record set by using a cursor.
 read more ...

Sequentially Number Records by Altering Table - Saturday, July 05, 2008
This example shows how to sequentially number records by altering table.
 read more ...

Sequential Numbering Record Set Using Temp Table - Tuesday, July 01, 2008
This example uses a temporary table to sequentially number a record set.
 read more ...

Top 100 Stored Proceudures by Execution Count - Friday, June 27, 2008
This example displays the top 100 stored procedures based on the number of times they have been executed.
 read more ...

Top 100 Stored Procedures by IO Counts - Monday, June 23, 2008
This example shows the top 100 stored procedures executed by IO counts.
 read more ...

Displaying SQL Server Agent Job Statistics - Thursday, June 19, 2008
This example displays SQL Server Agent Job statistics like, maximum duration, average duration and number of executions.
 read more ...

Finding Status of SQL Server Agent Using T-SQL - Sunday, June 15, 2008
This example allows you to determine the status of SQL Server Agent using T-SQL.
 read more ...

Finding the Worst Performing T-SQL Statements - Tuesday, June 10, 2008
This example is a stored procedure that will display the worst performing T-SQL statements on your server. It does this by using DMV's and DMF's.
 read more ...

Calculate Running SubTotals - Sunday, June 08, 2008
This example creates a running subtotals for each OrderDate.
 read more ...

Calculate Running Total Using Subquery - Monday, June 02, 2008
This example produces a running totals. It does this by using a subquery.
 read more ...


  
 SQL Server News
SQL Server 2008 RC0 is available - Tuesday, July 01, 2008
Microsoft has created RC0 for SQL Server 2008. If you have not yet download SQL Server 2008 to test it out now is the time.
 read more ...

SQL Server 2005 SP3 - Thursday, April 24, 2008
Are you tired of the Cumulative Updates from Microsoft?  Microsoft has announced they are planning on creating a SP3 for SQL Server 2005.
 read more ...

New SQL Server Monitor and Otimizer Tool - Friday, April 18, 2008
Confio Software, the leader in Wait-Time database performance management tools, today announced the SQL Server version of the new Confio Igniter Suite PI for monitoring, managing and optimizing databases and the applications that depend on them
 read more ...

New Visual Studio 2008 MCTS Exams - Monday, April 14, 2008
Three Visual Studio 2008 MCTS came out today (see below). Passing one of these exams along with the Exam 70-536 TS: .NET Framework, Application Development Foundation are need to get certified.

Exam 70-502 TS: .NET Framework 3.5, Windows Presentation Foundation Application Development
http://www.microsoft.com/learning/exams/70-502.mspx

Exam 70-503 TS: .NET Framework 3.5, Windows Communication Foundation Application Development
http/www.microsoft.com/learning/exams/70-503.mspx

Exam 70-504 TS: .NET Framework 3.5, Windows Workflow Foundation Application Development
http://www.microsoft.com/learning/exams/70-504.mspx
 

SQL Server Reporting Services Tutorials, Links and Resources - Saturday, April 12, 2008
SQL Server Reporting Services (part of SQL Server 2005) is a very useful toolset to add to your tool kit as a SharePoint Developer, Engineer, Administrator, user, etc. SharePoint Web parts and the good old report center can leverage integration with SSRS to solve many business reporting needs. Here are a few resources (not all) that you can use to bring you up to speed on using SSRS.
 read more ...


  
 SQL Server Patch Management Methodology Minimize
Location: BlogsGreg    
Posted by: greg 4/24/2008 4:58 AM
As most of you probably already know Cummulative Update #7 for SQL Server 2005 was released on April 17th. (http://support.microsoft.com/kb/949095). Also Microsoft has now said they will be providing a Service Pack 3 sometime after SQL Server 2008 has been release to manafacture (http://blogs.technet.com/dataplatforminsider/archive/2008/04/15/sql-server-2005-sp3-coming-soon.aspx). So one way or another you should consider how you plan to patch your SQL Server 2005 machines. 
As I see it there are three different patch management strategies you can take. The first option is every 8 weeks when a new Cummulative Update comes out from Microsoft install it. This will keep you up to date with all the fixes close to when they come out. The second option is to only apply  the specific hotfixes that you need to resolve what ever problems you encounter. And now with Server Pack 3 coming out in the future you have a third option, and that is wait until SP3 comes out and apply it.
Now in our shop we have decided to do use a combination of option 2 and 3. We have decided this because of this language in the Cummulative Updates:
A supported cumulative update package is now available from Microsoft. However, it is intended to correct only the problems that are described in this article. Apply it only to systems that are experiencing these specific problems. This cumulative update package may receive additional testing. Therefore, if you are not severely affected by any of these problems, we recommend that you wait for the next SQL Server 2005 service pack that contains the hotfixes in this cumulative update package.
We feel that if all fixes in a Cummulative Update have not be thoroughly tested then we don’t want to apply the Cummulative Update.  Although if we have a problem that is fixed with a particular hotfix then we will apply that hotfix patch.
Lastly we have decided that when applying a hotfix we will setup a test environment to verify the hotfix does in fact fix a problem we have identified. If we can’t verify it fixes a problem, and/or causes additional problems it will not be rolled into our production environment. When we apply Service Packs we also apply it in a test environment first. But we also will perform some additional application testing to verify nothing breaks due to rolling out a Service Pack.
So how are you applying Cummulative Updates, and what is your Patch Management Methodology?
Permalink |  Trackback

  
SQL Tools Heaven
Exceptional DBA
SQL Compare
Copyright 2007, 2008 by SQLServerExamples.com   Terms Of Use  Privacy Statement