SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Counter Table (table of numbers) Setter-Upper for SQL Server 2005

By Jesse Roberge,

Total article views: 762 | Views in the last 30 days: 12

Counter Table (table of numbers) Setter-Upper for SQL Server 2005
By Jesse Roberge - YeshuaAgapao@gmail.com

CounterSmall - completely fills a single data page (two logical reads per seek or scan). 622 Numbers.
Counter - completely fills a two-level clustered index (two logical reads per seek). 386,884 Numbers.
CounterBig - completely fills a three-level clustered index (three logical reads per seek). 240,641,848 Numbers.

CounterSmall and Counter populate in 2-4 seconds, including statistics and index rebuilds.
CounterBig is commented as it usually isn't needed. It takes a bit to populate this and pigs a lot of space. Un-comment it only if you need it.

Copyright:
Licensed under the L-GPL - a weak copyleft license - you are permitted to use this as a component of a proprietary database and call this from proprietary software.
Copyleft lets you do anything you want except plagarize, conceal the source, or prohibit copying & re-distribution of this script/proc.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

see <http://www.fsf.org/licensing/licenses/lgpl.html> for the license text.

By Jesse Roberge,

Total article views: 762 | Views in the last 30 days: 12
Your response
 
 
Related Articles
SCRIPT

Counter Table (table of numbers) Setter-Upper for SQL Server 2000

Sets up 3 'table of numbers' that completely fill a 1, 2, and 3-level clustered index respectivly wi...

FORUM

counters

counters help

FORUM

check counters

check counters

FORUM

Wierd Counter!

Please help me to create a conditional counter

FORUM

PerfMon Error

Counters

Tags
advanced querying    
counter    
development    
miscellaneous    
nums    
sql server 2005    
sqlinsider scripts    
table    
table of numbers    
tally    
t-sql    
t-sql aids    
 
Contribute

Free registration required...

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Login (existing users)

Login

Email:   Password:   Remember me: Forgotten your password?

Register (new users)

Register

Email:   Password:
Confirm:

Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

Steve Jones
Editor, SQLServerCentral.com