Short T-SQL stored procedure / random daily simulator
$10-30 USD
Em Andamento
Publicado há quase 9 anos
$10-30 USD
Pago na entrega
T-SQL Script to populate daily values in a table:
Create table with 2 columns
1. CurrentDate Date/Time
2. SimValue int
Write stored prcedure to return current Daily Simulated value for current minute as follows:
Exec CurrentDailySimValue(int Min, int Max) Returns Integer
Psuedo Code of the stored procedure:
1. Delete all values from a table prior to today – 1 day
2. Check to see if daily simulated value is availble for current minute, If available return value and exit;
3. Only If not availble:
DayStartMinute = randomize(@min,@max)
Insert DayStartMinute to table for 12:00AM of current date
For each minute from 12:01AM to 11:59PM of the current day{
Lastminutevalue = value of current minute - 1
NextMinute value = Lastminutevalue + randomize (value from -3 to +3)
Insert value for curent minute
}
Return value of current minute and exit;
All together there should be 1440 records populated for the current day (the procedure should only populate a day once)
Hi
Hope you well !
I am Vinod Kumar. I am working as Senior Software Developer in IT company. I have 4 + years experience in .NET with C#,VB,ASP.NET, Web Service, WCF, Javascript, JQuery, SQL, XML ,XSLT and HTML.