Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
CREATE PROCEDURE GetSensorSummary @SensorID int, @BegDate datetime, @EndDate datetime, @SensorDescription nvarchar(127) out, @MaxValue double out, @MaxTime datetime out, @MinValue double out, @MinTime datetime out AS BEGIN -- put the description from this query in @SensorDescription -- which I could do like this if only getting one value (I actually want to grab more than one): SET @SensorDescription = SELECT Description FROM SensorDef WHERE SensorID=@SensorID -- the queries below would also contain the date criteria in the WHERE clause (left out for brevity) SELECT TOP 1 DataValue, DataTime FROM SensorData WHERE SensorID=@SensorID ORDER BY DataValue DESC -- want to set @MaxValue=DataValue and @MaxTime=DataTime SELECT TOP 1 DataValue, DataTime FROM SensorData WHERE SensorID=@SensorID ORDER BY DataValue ASC -- want to set @MinValue=DataValue and @MinTime=DataTime END GO
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.