Random Number

The following SQL script will generate a single random number:

SELECT CAST(1000000-CEILING(RAND()* 899001) + (DATEPART(ss, GETDATE()) * 1000 ) + DATEPART(ms, GETDATE()) AS INT)

Pilip 29 Aug 2015 at 9:53 am

at the same time, you should also set up a job to reyccle the error logs on a scheduled basis. I changed the number of error logs to 26, then scheduled a job to reyccle on a weekly basis. That gives me 6 months of error logs as an archive(unless you do a reboot, which cycles the log as well.It also makes it easier to open the log, if you have to browse it.MSDB..sp_cycle_errorlogLeonard

Anonymous 27 Nov 2010 at 4:01 am

how to count hours based on date

Derek Dieter 27 Nov 2010 at 8:19 am

hi, to do this use:


Steven 29 Aug 2015 at 7:02 am

Thanks Michelle!! I was quite happy with the turnout and meteing in general so hopefully EDMPASS can keep up the momentum and get 30 people next monthIn looking at the 380PASS website I see you have Steve Wright presenting I’m going to be having Steve do the same presentaiton in an upcoming meteing. Be sure to let me know how it goesThanks again!!

Fernando 29 Aug 2015 at 11:18 am

Increasing the number of error logs allow you to see much fturher into the past for issues. On some of my larger servers where audit successful and failed logins the log fills up pretty darn quick. With only 6 files I can’t see but a couple of days.

Featured Articles

 Site Author

  • Thanks for visiting!