SQLServerCentral Article

SQLServerCentral.com Launches its New Contest!

Is your budget tight this year? Be the user who enriches the SQL Server community the most and receive the top prize of a full version of Lumigent's Log Explorer (a $995 value!). You could also win an Apress prize pack or a T-SQL Solutions subscription. Any SQLServerCentral.com user who helps to build the SQL Server community by submitting a script, posting in the forum or posting an original FAQ is eligible.

External Article

How to Setup Log Shipping with SQL 2000

This white paper outlines the following:

-The steps to configure Log Shipping between two or more servers that are running SQL Server 2000 Enterprise Edition.

-The steps to configure Log Shipping between Microsoft SQL Server 7.0 Service Pack 2 (SP2), or later, and Microsoft SQL Server 2000 Enterprise Edition.

-A brief comparison between Log Shipping and the other high availability-solutions that SQL Server provides.

External Article

XML Data Solutions

This sample is provided in conjunction with the MSDN Magazine article, "SQL Server 2000 and XML: Developing XML-Enabled Data Solutions for the Web." This article presents and compares five data access approaches, using a variety of technologies including ASP and ADO, XSLT, and DirectXML. Once built, the solutions are compared on the basis of their speed and efficiency.

Blogs

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

By

I’m hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM...

Counting Groups with Window Functions: #SQLNewBlogger

By

I looked at row_number() in a previous post. Now I want to build on...

Read the latest Blogs

Forums

Find rows with very close time stamps

By daytonbrown2

Given the following table and query, this will return any records(based on message_id) that...

How to merge two tables with unlike fields

By landonh

How to merge two tables with unlike fields. I have two table with one...

Visual Studio 22 / SSIS Project / (Project) Connection problem

By WilburSmith

Hello, First of all, I find it odd/annoying that I can't exclude a Project...

Visit the forum

Question of the Day

The LAGging NULL

I have this data in a SQL Server 2022 table:

player         yearid team HR
Alex Rodriguez 2012   NYY  18
Alex Rodriguez 2013   NYY  7
Alex Rodriguez 2014   NYY  NULL
Alex Rodriguez 2015   NYY  12
Alex Rodriguez 2016   NYY  9
If I run this code, what are the results returned in the hrgrowth column?
SELECT
  player
, yearid
, hr
, hr - LAG (hr, 1, 0) IGNORE NULLS OVER (ORDER BY yearid) AS hrgrowth
FROM dbo.playerstats;

See possible answers