
[dbo].[LSYFileServerStatsThView]
CREATE view LSYFileServerStatsThView AS SELECT LSYFileServerStats.server_addr, LSYFileServerStats.probe_addr, LSYFileServerStats.probeIndex, LSYFileServerStats.fileServerKeyId, IntervalDateTime, IntervalDuration, readSvcSum=case WHEN readSvcCount= 0 THEN 0 ELSE readSvcSum/readSvcCount END, readbytes=case WHEN IntervalDuration= 0 THEN 0 ELSE readbytes/IntervalDuration END, writeSvcSum=case WHEN writeSvcCount= 0 THEN 0 ELSE writeSvcSum/writeSvcCount END, writebytes=case WHEN IntervalDuration= 0 THEN 0 ELSE writebytes/IntervalDuration END, otherSvcSum=case WHEN otherSvcCount= 0 THEN 0 ELSE otherSvcSum/otherSvcCount END, SIOSum=case WHEN SIOCount= 0 THEN 0 ELSE SIOSum/SIOCount END, linkErrCount=case WHEN pktsToServer= 0 THEN 0 ELSE linkErrCount/pktsToServer END, FSErrCount=case WHEN (readSvcCount+writeSvcCount+otherSvcCount)= 0 THEN 0 ELSE FSErrCount /(readSvcCount+writeSvcCount+otherSvcCount) END FROM LSYFileServerStats
GO
GRANT SELECT ON [dbo].[LSYFileServerStatsThView] TO [uniadmin]
GO