mat-musings [mat-myoo-zings]: the written expressions of my contemplations about a variety of topics
NOTE: I reserve the right to delete comments at my own discretion (off-topic, uncivilized, etc). Information provided herein is provided “as is” with no warranties and confers no rights. Opinions expressed herein are mine, and do not necessarily represent the opinions of my employer (EarthSoft, Inc.).
Monday, February 20, 2012
TSQL - counter/increment/rownumber
Here is a fairly easy way to get a row number in SQL Server (2005 or later):
DECLARE @seed INT = 100
SELECT
@seed + ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS RowNumber
No comments:
Post a Comment