SHARE
TWEET

Untitled

a guest Dec 12th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. USE ExpensiveCars
  2. GO
  3.  
  4. CREATE PROCEDURE RunTableTestsProc
  5. AS
  6. BEGIN
  7.     DECLARE @x int
  8.     SELECT @x = TestRunID FROM TestRuns WHERE Description = 'Delete'
  9.  
  10.     DECLARE @ds DATETIME
  11.     DECLARE @de DATETIME
  12.     DECLARE @exe VARCHAR(50)
  13.  
  14.     SET @exe = 'TestDelete1'
  15.     SET @ds = GETDATE()
  16.     EXECUTE @exe
  17.     SET @de = GETDATE()
  18.     INSERT INTO TestRunTables(TestRunID, TableID, StartAT, EndAt) VALUES (@x, 1, @ds, @de)
  19.  
  20.     SET @exe = 'TestDelete2'
  21.     SET @ds = GETDATE()
  22.     EXECUTE @exe
  23.     SET @de = GETDATE()
  24.     INSERT INTO TestRunTables(TestRunID, TableID, StartAT, EndAt) VALUES (@x, 2, @ds, @de)
  25.  
  26.     SET @exe = 'TestDelete3'
  27.     SET @ds = GETDATE()
  28.     EXECUTE @exe
  29.     SET @de = GETDATE()
  30.     INSERT INTO TestRunTables(TestRunID, TableID, StartAT, EndAt) VALUES (@x, 3, @ds, @de)
  31.  
  32.     SELECT @x = TestRunID FROM TestRuns WHERE Description = 'Insert'
  33.  
  34.     SET @exe = 'TestInsert1'
  35.     SET @ds = GETDATE()
  36.     EXECUTE @exe
  37.     SET @de = GETDATE()
  38.     INSERT INTO TestRunTables(TestRunID, TableID, StartAT, EndAt) VALUES (@x, 1, @ds, @de)
  39.     SET @exe = 'TestInsert2'
  40.     SET @ds = GETDATE()
  41.     EXECUTE @exe
  42.     SET @de = GETDATE()
  43.     INSERT INTO TestRunTables(TestRunID, TableID, StartAT, EndAt) VALUES (@x, 2, @ds, @de)
  44.     SET @exe = 'TestInsert3'
  45.     SET @ds = GETDATE()
  46.     EXECUTE @exe
  47.     SET @de = GETDATE()
  48.     INSERT INTO TestRunTables(TestRunID, TableID, StartAT, EndAt) VALUES (@x, 3, @ds, @de)
  49.  
  50. END
  51.  
  52. -- EXECUTE RunTableTestsProc
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top