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.