Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= CREATE PROCEDURE TimeDifferenceSecs -- Add the parameters for the stored procedure here @batchnumber int = 99, @vessel varchar(50) = "??", @firstdate as datetime, @lastdate as datetime, @difference as datetime AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here set @firstdate = SELECT top 1 datetimecol from Test_01.Table_1 where batchcol = @batchnumber order by datetimecol ASC set @lastdate = SELECT top 1 datetimecol from Test_01.Table_1 where batchcol = @batchnumber order by datetimecol DES set @difference = Datediff("s",@firstdate,@lastdate) END GO
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
23 Experts available now in Live!