Hi, Tell me how to create the script on PS, with such algorithm
1. there is a csv file
"C: \ Users \ admin \ Documents \ f.csv"
its format is now
"", "promoaction", "promoeffect1", "returneff", "promo_return", "dataload"
"1", 18557,18568,0,18557,2019-03-23 17:11:28
every Monday morning, at 11 o'clock, the csv file is updated with a new row
for example, the 25th march may be so.
"", "promoaction", "promoeffect1", "returneff", "promo_return", "dataload"
“2”, 18558.18568.0.18558.2019-03-25 11:00:00
2. So, how to do, that if the values of columns
promoaction and
promo_return (do not touch other columns, their value is not important)
less than their values in previous date (dataload column)
for example
"", "promoaction", "promoeffect1", "returneff", "promo_return", "dataload"
"3", 1000,18568,0,1000,2019-03-25 11:00:00 (1000 <18558)
and also, if values in promoaction and promo_return columns became not equal, for example, in
promoaction = 1000, and in
promo_return = 2000
all tasks in SQL Task Scheduler (SQL agent) in my SMSS
should not start, but simply postpone execution to the next day. for example if task must be done in 26th march, it should done in thuesday 2 apr and so on
Well, if in
promoaction and
promo_return values are greater than on the previous date, and the values promoaction = promo_return
then everything is fine, do not turn off anything
This ps should run every mon at 12 noon.
How to create such script?
if it is needed addition information
path to my SQL Agent
C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\SQLAGENT.OUT
name of sqlngn01(sql server 13.0.5081.1 - chlebozavod7\smith)