Page 1 of 1
Numbers Sequence
Posted: Tue Aug 10, 2004 2:57 pm
by kommven
I like KeyMgtGetNextValue.
Can you tell me how to reset it?
Posted: Tue Aug 10, 2004 4:17 pm
by KeithM
You can reset it through the command line in the administrator. The command is: UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'key_you _want_to_reset';
Posted: Tue Aug 10, 2004 4:23 pm
by chucksmith
KeyMgtGetNextValue stores values in a hash file named
SDKSequences. You could
CAREFULLY update the values in this file.
I suggest you start by trying to view the file first. Create a job as follows:
Code: Select all
HASH ----> XFR ----> SEQ (later add a HASH output, too)
Define two columns in your input hash file stage: KEY which is your key column (a varchar), and VALUE which is the value associated with the KEY (an integer).
Now just VIEW DATA. Get a feel for the file. By updating this file, you can reset the values. Practice writing to a sequential file, and before you make this a production job, include a sequential output file that reports the old and new values, so you have a recovery option.
Posted: Tue Aug 10, 2004 6:36 pm
by kduke
We have a job with 2 parameters TableName and ColumnName. The value of the hash file key is always TableName so all it does is route this one value to the hash file.
select max(#ColumnName#) from #TableName#
This is my source query.
Posted: Wed Aug 11, 2004 7:32 am
by kommven
I think doing SQL will retard my process. I will try with reset thing, Thanks Keith.
Any more suggestions? PLEASE
Posted: Wed Aug 11, 2004 8:47 am
by kduke
A surrogate key is a primary key. So if you select Max() on it then it returns very fast. The job in question is a multiple instance job. It is called by all our jobs. The instance id is set to the TableName. Works great. I think someone at ASCL originally wrote it.