I wanted to know if I could get the "SET STATISTICS TIME ON" result. For example, the result of my query gave 1139ms. Can I get this result and manipulate it? Convert to seconds, minutes, write to a table ...
I do not think it's possible, in any case you'll achieve the same result by manipulating two variables.
DECLARE @ExecInicio DATETIME2(7)
DECLARE @ExecTermino DATETIME2(7)
SET @ExecInicio = sysdatetime();
-- MinhaQuery
SET @ExecTermino = sysdatetime();
SELECT DATEDIFF(SECOND, @ExecInicio, @ExecTermino) -- segundos.