Advertisement
Guest User

Create MiniProfiler Tables

a guest
Sep 7th, 2011
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 3.25 KB | None | 0 0
  1. create table MiniProfilers
  2.   (
  3.      Id                                   uniqueidentifier not null primary key,
  4.      Name                                 nvarchar(200) not null,
  5.      Started                              datetime not null,
  6.      MachineName                          nvarchar(100) null,
  7.      [User]                               nvarchar(100) null,
  8.      Level                                tinyint null,
  9.      RootTimingId                         uniqueidentifier null,
  10.      DurationMilliseconds                 decimal(7, 1) not null,
  11.      DurationMillisecondsInSql            decimal(7, 1) null,
  12.      HasSqlTimings                        bit not null,
  13.      HasDuplicateSqlTimings               bit not null,
  14.      HasTrivialTimings                    bit not null,
  15.      HasAllTrivialTimings                 bit not null,
  16.      TrivialDurationThresholdMilliseconds decimal(5, 1) null,
  17.      HasUserViewed                        bit not null
  18.   )
  19.  
  20. create table MiniProfilerTimings
  21.   (
  22.      RowId                               integer primary key identity, -- sqlite: replace identity with autoincrement
  23.      Id                                  uniqueidentifier not null,
  24.      MiniProfilerId                      uniqueidentifier not null,
  25.      ParentTimingId                      uniqueidentifier null,
  26.      Name                                nvarchar(200) not null,
  27.      Depth                               smallint not null,
  28.      StartMilliseconds                   decimal(7, 1) not null,
  29.      DurationMilliseconds                decimal(7, 1) not null,
  30.      DurationWithoutChildrenMilliseconds decimal(7, 1) not null,
  31.      SqlTimingsDurationMilliseconds      decimal(7, 1) null,
  32.      IsRoot                              bit not null,
  33.      HasChildren                         bit not null,
  34.      IsTrivial                           bit not null,
  35.      HasSqlTimings                       bit not null,
  36.      HasDuplicateSqlTimings              bit not null,
  37.      ExecutedReaders                     smallint not null,
  38.      ExecutedScalars                     smallint not null,
  39.      ExecutedNonQueries                  smallint not null
  40.   )
  41.  
  42. create table MiniProfilerSqlTimings
  43.   (
  44.      RowId                          integer primary key identity, -- sqlite: replace identity with autoincrement
  45.      Id                             uniqueidentifier not null,
  46.      MiniProfilerId                 uniqueidentifier not null,
  47.      ParentTimingId                 uniqueidentifier not null,
  48.      ExecuteType                    tinyint not null,
  49.      StartMilliseconds              decimal(7, 1) not null,
  50.      DurationMilliseconds           decimal(7, 1) not null,
  51.      FirstFetchDurationMilliseconds decimal(7, 1) null,
  52.      IsDuplicate                    bit not null,
  53.      StackTraceSnippet              nvarchar(200) not null,
  54.      CommandString                  nvarchar(max) not null -- sqlite: remove (max)
  55.   )
  56.  
  57. create table MiniProfilerSqlTimingParameters
  58.   (
  59.      MiniProfilerId    uniqueidentifier not null,
  60.      ParentSqlTimingId uniqueidentifier not null,
  61.      Name              varchar(130) not null,
  62.      DbType            varchar(50) null,
  63.      Size              int null,
  64.      Value             nvarchar(max) null -- sqlite: remove (max)
  65.   )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement