sql2000 identity randomize increment

liunx

Guest
HI i have a bigint identity field.

right now i have the increment = 3 so it wont be noticable it increase in a seri (im actually going to use 13 so it gets really hard to find it).

Now the q: identity increment doesnt let u use code in it like DATEPART(second, GETDATE()), so it could randomly increase, is there a way to make it change randomly, i was thinking to do a scheduled job for changing it. Besides the job running would it cause any problems in the indexing or somewhere else.

Any ideas thanksYou confused me!

What exactly are you trying to do (the big picture) so I can picture this.cause an random increment so no one can tell what was the previous, number is
i dont want to use unique identifyer because its too long and complicated, and i dont wantto use something get the code complicated basic integer, that increases randomly.

This number is going to be given to the client and i dont want them to find other records so easyly, (No password protection dont even think about it :P:P)But you do not want the number to occur two times?

Just when an account is made or whatever use rnd to create a number, check the db see if it is there, if it is not plug it in.

is that what you were going for and you help with doing something like that?

or is it

just grab the last number and use rnd to add to it? since you said incriment, which I guess this would prevent the same number from reoccuring.

you would have to do this in the code though, there is no way to do it with sql server. But it is possible, but like I said it is going to be through code. You can still have this random number feild be your identity feild though.you would have to do this in the code though, there is no way to do it with sql server.

This is what im looking for, this is not just for this specific coding i could use this in alot of places. I bet there could be a way to get this done, some genius way to get it done, no biggy.

Thanks for the idea, but i already knew that icould do it by coding, i was just being lazzy so i could use the idea in different places.


If i can find a way to change the increament by codin i could put it in a trigger or a daly job, how often that i want to get it change that would be the thing.Well, maybe you should email microsoft and tell them to get with it :p. They are working on the next vers of sql server quite quickly I hear, because it is a neccessary part of WINFS. Winfs is just going to be a file system built on sql server... I think it will be 500 times faster and 500 times less stable.
 
Back
Top