CopyPastor

Detecting plagiarism made easy.

Score: 0.8633141106572645; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2024-04-02
by Jerry Nixon

Original Post

Original - Posted on 2024-04-02
by Jerry Nixon



            
Present in both answers; Present only in the new answer; Present only in the old answer;

This is a good solution.
````sql CREATE OR ALTER FUNCTION [dbo].[Sleep](@seconds INT) RETURNS INT AS BEGIN DECLARE @startTime DATETIME2(7) = SYSDATETIME(); DECLARE @endTime DATETIME2(7) = DATEADD(SECOND, @seconds, @startTime); WHILE (SYSDATETIME() < @endTime) SET @startTime = @startTime; RETURN @seconds; END
GO CREATE OR ALTER VIEW dbo.SlowView AS SELECT [dbo].[Sleep](5) AS DELAY, NEWID() AS VALUE
GO SELECT * FROM SlowView ````
This is a good solution.
```SQL CREATE OR ALTER FUNCTION [dbo].[Sleep](@seconds INT) RETURNS INT AS BEGIN DECLARE @startTime DATETIME2(7) = SYSDATETIME(); DECLARE @endTime DATETIME2(7) = DATEADD(SECOND, @seconds, @startTime); WHILE (SYSDATETIME() < @endTime) SET @startTime = @startTime; RETURN @seconds; END
GO CREATE OR ALTER VIEW dbo.SlowView AS SELECT [dbo].[Sleep](5) AS DELAY, NEWID() AS VALUE
GO SELECT * FROM SlowView ````

        
Present in both answers; Present only in the new answer; Present only in the old answer;