Efficient way to delete specific rows of a SAS dataset on a SQL Server -
Efficient way to delete specific rows of a SAS dataset on a SQL Server -
i want delete latest 30 day records dataset. have couple of ways so.
proc sql; delete server.data date >= today() - 30; quit;
or
data server.data; set server.data(where= (date>= today() - 30)); run;
which way better? or faster procedures?
the first approach faster.
however approach leaves deleted observations in place (they marked deleted). causes difference between nobs , nlobs properties of table. if space consideration, i'd recommend sec approach (using macro variable constant in same manner). rebuild table without records. remember recreate indexes , constraints, destroyed in rebuild process..
edit: had suggested below faster, turned out not case - see joe's comment in thread..
proc sql; delete server.data date >= %eval(%sysfunc(today()) - 30);
sql-server sas delete-row sql-delete
Comments
Post a Comment