Well, datediff specifically looks at difference between two dates. Ticks, according to the help, is the number of 100 nanosecond intervals (the Windows clock tick time) between now and Jan1, 0001 (I've worked it out - it's correct). So depends what you want. I guess ticks is good for generating numbers which will not be repeated on a particular machine.
I've just done a little test and those numbers seem to be only accurate to the last but two significant figures, so I'm not sure if .net is really able to get it this precisely. You might want to do a test to see if it is going to cause you a problem.
Or you may prefer a different method of generating an ID. Is this for an RDBMS?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.