M
Mark
I am using a stored predecure from an Access project file to create data for a MSSQL table. But the problem is that it only return the first 10,000 records for me. Here is the code, how can I get it to return all the records?
Alter Procedure stoChange
/*
This stored precedure is for produce a table for growing stock changes such as growth, mortality and removal
*/
As
TRUNCATE TABLE Change
INSERT Change
SELECT TOP 100 PERCENT
Growth, Mortality, Removal,
STATUSCD, TREECLCD, DIA,
COUNTYCD, PLOT, TREE, CONDID,
COUNTY,
Region,
LANDCLCD, RESERVCD, SITECLCD,
oLANDCLCD, oRESERVCD, oSITECLCD,
SPCD, SPGRPCD,
/* ownership information from the new condition table.
OWNCD,
OWNGRPCD,
FORINDCD,
ownership information from the old condition table.
oOWNCD,
oOWNGRPCD,
oFORINDCD,
*/
/* the following three cases combined ownership information from new and old condition tables,
if a land has been cut and turned into non-forest land, current ownership information will not be available,
the ownership information in the old condition table will be used.
*/
CASE
WHEN [OWNCD] =-1 THEN [oOWNCD] ELSE OWNCD END AS nOWNCD,
CASE
WHEN [OWNGRPCD] =-1 THEN [oOWNGRPCD] ELSE OWNGRPCD END AS nOWNGRPCD,
CASE
WHEN [FORINDCD] =-1 THEN [oFORINDCD] ELSE FORINDCD END AS nFORINDCD,
CASE
WHEN [SPGRPCD] <=24 THEN 'SW' ELSE 'HW' END AS MJSPGRP,
CASE
WHEN [DIA]<9 And [DIA]>=5 THEN 'Pulpwood'
WHEN [DIA]<11 And [DIA]<=9 THEN 'ChipnSaw'
WHEN [DIA]>=11 THEN 'Sawlog'
ELSE 'Saplings' END AS WoodType,
CASE
WHEN [FORTYPCD]<400 THEN 'Pine'
WHEN [FORTYPCD]<500 THEN 'Mixed'
ELSE 'Hwd' END AS ForestType
FROM vChange
/* set nocount on */
return
Alter Procedure stoChange
/*
This stored precedure is for produce a table for growing stock changes such as growth, mortality and removal
*/
As
TRUNCATE TABLE Change
INSERT Change
SELECT TOP 100 PERCENT
Growth, Mortality, Removal,
STATUSCD, TREECLCD, DIA,
COUNTYCD, PLOT, TREE, CONDID,
COUNTY,
Region,
LANDCLCD, RESERVCD, SITECLCD,
oLANDCLCD, oRESERVCD, oSITECLCD,
SPCD, SPGRPCD,
/* ownership information from the new condition table.
OWNCD,
OWNGRPCD,
FORINDCD,
ownership information from the old condition table.
oOWNCD,
oOWNGRPCD,
oFORINDCD,
*/
/* the following three cases combined ownership information from new and old condition tables,
if a land has been cut and turned into non-forest land, current ownership information will not be available,
the ownership information in the old condition table will be used.
*/
CASE
WHEN [OWNCD] =-1 THEN [oOWNCD] ELSE OWNCD END AS nOWNCD,
CASE
WHEN [OWNGRPCD] =-1 THEN [oOWNGRPCD] ELSE OWNGRPCD END AS nOWNGRPCD,
CASE
WHEN [FORINDCD] =-1 THEN [oFORINDCD] ELSE FORINDCD END AS nFORINDCD,
CASE
WHEN [SPGRPCD] <=24 THEN 'SW' ELSE 'HW' END AS MJSPGRP,
CASE
WHEN [DIA]<9 And [DIA]>=5 THEN 'Pulpwood'
WHEN [DIA]<11 And [DIA]<=9 THEN 'ChipnSaw'
WHEN [DIA]>=11 THEN 'Sawlog'
ELSE 'Saplings' END AS WoodType,
CASE
WHEN [FORTYPCD]<400 THEN 'Pine'
WHEN [FORTYPCD]<500 THEN 'Mixed'
ELSE 'Hwd' END AS ForestType
FROM vChange
/* set nocount on */
return