StackOverflowDocumentation
.dbo
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
usp_insertUsers
Parameters
Name
Type
Mode
Definition
CREATE PROC [dbo].[usp_insertUsers] AS BEGIN /* Assign randomly -- was sehe ich in Capture...wenn nur den Prozeduraufruf randomInsert oder randomQ dann muss ich drum herum arbeiten...z.B: Prozeduren auslagern in andere Datenbank */ /* Determine count of users added within the workload recorded This is a helper to get the workload and the inserts deterministic rather than having random inputs */ DECLARE @count INT = (SELECT COUNT(*) FROM dbo.Users WHERE CreationDate > '20200512') + 1; INSERT INTO dbo.Users ( Age, CreationDate, DisplayName, DownVotes, LastAccessDate, Reputation, UpVotes, [Views] ) VALUES ( 37, -- Age - int '20200512 17:00', -- CreationDate - datetime 'WORKLOADUSER' + CAST(@count AS VARCHAR(20)), -- DISPLAYNAME - NVARCHAR 0, -- DownVotes - int '20200512 18:00', -- LastAccessDate - datetime @count*100, -- Reputation - int @count*2, -- UpVotes - int @count/20 -- Views - int ) ; END