Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(DATEPART(HOUR, GETDATE())=23) begin
- BEGIN TRY
- declare @minID int = (select top 1 id from as_trace where cast(created as date) = cast(getdate() as date))
- declare @p ExtendedDictionaryParameter
- insert into @p ([Key], value2)
- select '', code + ','+ cast(count(*) as nvarchar) from as_trace
- where id>=@minID
- group by code
- order by code desc
- select 'apirequest' type,
- 'diag' code, 'data' p1_name, isnull(dbo.as_agg(@p, '||'), '') p1_value, 'p' p2_name, 'xxx' p2_value
- END TRY
- BEGIN CATCH
- print error_message()
- END CATCH
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement