-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.sql
11214 lines (8755 loc) · 515 KB
/
script.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
create database SimWorld collate SQL_Latin1_General_CP1_CI_AS
go
create table Account
(
username varchar(30) not null
primary key,
password varchar(30) not null,
fullName nvarchar(30),
isRemoved bit default '0' not null
)
go
create table NetworkOperator
(
id int identity
constraint NetworkOperator_pk
primary key nonclustered,
name varchar(30) not null
)
go
create unique index NetworkOperator_name_uindex
on NetworkOperator (name)
go
create table [Order]
(
id int identity
constraint Order_pk
primary key nonclustered,
name nvarchar(30) not null,
phoneMask varchar(11),
timestamp nvarchar(30)
)
go
create unique index Order_id_uindex
on [Order] (id)
go
create unique index Order_phoneMask_name_timestamp_uindex
on [Order] (phoneMask, name, timestamp)
go
create table PhongThuy
(
number int not null
constraint PhongThuy_pk
primary key nonclustered,
mean nvarchar(1000) not null,
brief nvarchar(50) not null
)
go
create unique index PhongThuy_number_uindex
on PhongThuy (number)
go
create table Supplier
(
id int identity
constraint Supplier_pk
primary key nonclustered,
name nvarchar(30) not null,
website varchar(2048) not null
)
go
create unique index Supplier_id_uindex
on Supplier (id)
go
create unique index Supplier_name_uindex
on Supplier (name)
go
create unique index Supplier_website_uindex
on Supplier (website)
go
create table Tag
(
id int identity
constraint Tag_pk
primary key nonclustered,
tagName nvarchar(30) not null
)
go
create table Sim
(
phone varchar(10) not null
constraint Sim_pk
primary key nonclustered,
price bigint not null,
networkOperatorId int not null
constraint Sim_NetworkOperator_id_fk
references NetworkOperator
on delete cascade,
tagId int
constraint Sim_Tag_id_fk
references Tag
on delete cascade,
supplierId int not null
constraint Sim_Supplier_id_fk
references Supplier,
phongThuyNumber int
)
go
create unique index Sim_phone_uindex
on Sim (phone)
go
create unique index Tag_tagName_uindex
on Tag (tagName)
go
create table sys.filestream_tombstone_2073058421
(
column_guid uniqueidentifier,
file_id int not null,
filestream_value_name nvarchar(260),
oplsn_bOffset int not null,
oplsn_fseqno int not null,
oplsn_slotid int not null,
rowset_guid uniqueidentifier not null,
size bigint,
status bigint not null,
transaction_sequence_num bigint not null
)
go
create unique clustered index FSTSClusIdx
on sys.filestream_tombstone_2073058421 (oplsn_fseqno, oplsn_bOffset, oplsn_slotid)
go
create index FSTSNCIdx
on sys.filestream_tombstone_2073058421 (file_id, rowset_guid, column_guid, oplsn_fseqno, oplsn_bOffset,
oplsn_slotid)
go
create table sys.filetable_updates_2105058535
(
item_guid uniqueidentifier not null,
oplsn_bOffset int not null,
oplsn_fseqno int not null,
oplsn_slotid int not null,
table_id bigint not null
)
go
create unique clustered index FFtUpdateIdx
on sys.filetable_updates_2105058535 (table_id, oplsn_fseqno, oplsn_bOffset, oplsn_slotid, item_guid)
go
create table sys.persistent_version_store
(
min_len smallint,
prev_row_in_chain binary(8) not null,
row_version varbinary(8000) not null,
rowset_id bigint not null,
sec_version_rid binary(8) not null,
seq_num bigint,
subid_push int,
subid_tran int,
xdes_ts_push bigint not null,
xdes_ts_tran bigint not null
)
go
create table sys.persistent_version_store_long_term
(
min_len smallint,
prev_row_in_chain binary(8) not null,
row_version varbinary(8000) not null,
rowset_id bigint not null,
sec_version_rid binary(8) not null,
seq_num bigint,
subid_push int,
subid_tran int,
xdes_ts_push bigint not null,
xdes_ts_tran bigint not null
)
go
create table sys.plan_persist_context_settings
(
acceptable_cursor_options int not null,
compatibility_level smallint not null,
context_settings_id bigint not null,
date_first tinyint not null,
date_format smallint not null,
default_schema_id int not null,
is_replication_specific bit not null,
language_id smallint not null,
merge_action_type smallint not null,
required_cursor_options int not null,
set_options int not null,
status smallint not null,
status2 tinyint not null
)
go
create unique clustered index plan_persist_context_settings_cidx
on sys.plan_persist_context_settings (context_settings_id desc)
go
create table sys.plan_persist_plan
(
compatibility_level smallint not null,
count_compiles bigint not null,
engine_version bigint not null,
force_failure_count bigint not null,
initial_compile_start_time datetimeoffset not null,
is_forced_plan bit not null,
is_online_index_plan bit not null,
is_parallel_plan bit not null,
is_trivial_plan bit not null,
last_compile_duration bigint not null,
last_compile_start_time datetimeoffset not null,
last_execution_time datetimeoffset,
last_force_failure_reason int not null,
plan_flags int,
plan_group_id bigint,
plan_id bigint not null,
query_id bigint not null,
query_plan varbinary(max),
query_plan_hash binary(8) not null,
total_compile_duration bigint not null
)
go
create unique clustered index plan_persist_plan_cidx
on sys.plan_persist_plan (plan_id)
go
create index plan_persist_plan_idx1
on sys.plan_persist_plan (query_id desc)
go
create table sys.plan_persist_query
(
batch_sql_handle varbinary(64),
compile_count bigint not null,
context_settings_id bigint not null,
initial_compile_start_time datetimeoffset not null,
is_internal_query bit not null,
last_bind_cpu_time bigint not null,
last_bind_duration bigint not null,
last_compile_batch_offset_end bigint not null,
last_compile_batch_offset_start bigint not null,
last_compile_batch_sql_handle varbinary(64),
last_compile_duration bigint not null,
last_compile_memory_kb bigint not null,
last_compile_start_time datetimeoffset not null,
last_execution_time datetimeoffset,
last_optimize_cpu_time bigint not null,
last_optimize_duration bigint not null,
last_parse_cpu_time bigint not null,
last_parse_duration bigint not null,
max_compile_memory_kb bigint not null,
object_id bigint,
query_flags int,
query_hash binary(8) not null,
query_id bigint not null,
query_param_type tinyint not null,
query_text_id bigint not null,
statement_sql_handle varbinary(64),
status tinyint not null,
total_bind_cpu_time bigint not null,
total_bind_duration bigint not null,
total_compile_duration bigint not null,
total_compile_memory_kb bigint not null,
total_optimize_cpu_time bigint not null,
total_optimize_duration bigint not null,
total_parse_cpu_time bigint not null,
total_parse_duration bigint not null
)
go
create unique clustered index plan_persist_query_cidx
on sys.plan_persist_query (query_id)
go
create index plan_persist_query_idx1
on sys.plan_persist_query (query_text_id, context_settings_id)
go
create table sys.plan_persist_query_hints
(
batch_sql_handle varbinary(64),
comment nvarchar(max),
context_settings_id bigint not null,
last_query_hint_failure_reason int not null,
object_id bigint,
query_hash binary(8) not null,
query_hint_failure_count bigint not null,
query_hint_id bigint not null,
query_hints nvarchar(max),
query_hints_flags int,
query_id bigint not null,
query_param_type tinyint not null,
statement_sql_handle varbinary(64) not null
)
go
create unique clustered index plan_persist_query_hints_cidx
on sys.plan_persist_query_hints (query_hint_id)
go
create unique index plan_persist_query_hints_idx1
on sys.plan_persist_query_hints (query_hint_id)
go
create table sys.plan_persist_query_template_parameterization
(
comment nvarchar(max),
last_parameterization_failure_reason int not null,
parameterization_failure_count bigint not null,
query_param_type tinyint not null,
query_template nvarchar(max),
query_template_flags int,
query_template_hash varbinary(16) not null,
query_template_id bigint not null,
status tinyint not null
)
go
create unique clustered index plan_persist_query_template_parameterization_cidx
on sys.plan_persist_query_template_parameterization (query_template_id)
go
create unique index plan_persist_query_template_parameterization_idx1
on sys.plan_persist_query_template_parameterization (query_template_hash)
go
create table sys.plan_persist_query_text
(
has_restricted_text bit not null,
is_part_of_encrypted_module bit not null,
query_sql_text nvarchar(max),
query_template_hash varbinary(16),
query_text_id bigint not null,
statement_sql_handle varbinary(64) not null
)
go
create unique clustered index plan_persist_query_text_cidx
on sys.plan_persist_query_text (query_text_id)
go
create unique index plan_persist_query_text_idx1
on sys.plan_persist_query_text (statement_sql_handle)
go
create table sys.plan_persist_runtime_stats
(
count_executions bigint not null,
execution_type tinyint not null,
first_execution_time datetimeoffset not null,
last_clr_time bigint not null,
last_cpu_time bigint not null,
last_dop bigint not null,
last_duration bigint not null,
last_execution_time datetimeoffset not null,
last_log_bytes_used bigint,
last_logical_io_reads bigint not null,
last_logical_io_writes bigint not null,
last_num_physical_io_reads bigint,
last_physical_io_reads bigint not null,
last_query_max_used_memory bigint not null,
last_rowcount bigint not null,
last_tempdb_space_used bigint,
max_clr_time bigint not null,
max_cpu_time bigint not null,
max_dop bigint not null,
max_duration bigint not null,
max_log_bytes_used bigint,
max_logical_io_reads bigint not null,
max_logical_io_writes bigint not null,
max_num_physical_io_reads bigint,
max_physical_io_reads bigint not null,
max_query_max_used_memory bigint not null,
max_rowcount bigint not null,
max_tempdb_space_used bigint,
min_clr_time bigint not null,
min_cpu_time bigint not null,
min_dop bigint not null,
min_duration bigint not null,
min_log_bytes_used bigint,
min_logical_io_reads bigint not null,
min_logical_io_writes bigint not null,
min_num_physical_io_reads bigint,
min_physical_io_reads bigint not null,
min_query_max_used_memory bigint not null,
min_rowcount bigint not null,
min_tempdb_space_used bigint,
plan_id bigint not null,
runtime_stats_id bigint not null,
runtime_stats_interval_id bigint not null,
sumsquare_clr_time float not null,
sumsquare_cpu_time float not null,
sumsquare_dop float not null,
sumsquare_duration float not null,
sumsquare_log_bytes_used float,
sumsquare_logical_io_reads float not null,
sumsquare_logical_io_writes float not null,
sumsquare_num_physical_io_reads float,
sumsquare_physical_io_reads float not null,
sumsquare_query_max_used_memory float not null,
sumsquare_rowcount float not null,
sumsquare_tempdb_space_used float,
total_clr_time bigint not null,
total_cpu_time bigint not null,
total_dop bigint not null,
total_duration bigint not null,
total_log_bytes_used bigint,
total_logical_io_reads bigint not null,
total_logical_io_writes bigint not null,
total_num_physical_io_reads bigint,
total_physical_io_reads bigint not null,
total_query_max_used_memory bigint not null,
total_rowcount bigint not null,
total_tempdb_space_used bigint
)
go
create unique clustered index plan_persist_runtime_stats_cidx
on sys.plan_persist_runtime_stats (plan_id, runtime_stats_interval_id, execution_type)
go
create unique index plan_persist_runtime_stats_idx1
on sys.plan_persist_runtime_stats (runtime_stats_id)
go
create table sys.plan_persist_runtime_stats_interval
(
comment nvarchar(max),
end_time datetimeoffset not null,
runtime_stats_interval_id bigint not null,
start_time datetimeoffset not null
)
go
create unique clustered index plan_persist_runtime_stats_interval_cidx
on sys.plan_persist_runtime_stats_interval (runtime_stats_interval_id)
go
create index plan_persist_runtime_stats_interval_idx1
on sys.plan_persist_runtime_stats_interval (end_time)
go
create table sys.plan_persist_wait_stats
(
count_executions bigint not null,
execution_type tinyint not null,
last_query_wait_time_ms bigint not null,
max_query_wait_time_ms bigint not null,
min_query_wait_time_ms bigint not null,
plan_id bigint not null,
runtime_stats_interval_id bigint not null,
sumsquare_query_wait_time_ms float not null,
total_query_wait_time_ms bigint not null,
wait_category smallint not null,
wait_stats_id bigint not null
)
go
create unique clustered index plan_persist_wait_stats_cidx
on sys.plan_persist_wait_stats (runtime_stats_interval_id, plan_id, wait_category, execution_type)
go
create unique index plan_persist_wait_stats_idx1
on sys.plan_persist_wait_stats (wait_stats_id)
go
create table sys.queue_messages_1977058079
(
binary_message_body varbinary(max),
conversation_group_id uniqueidentifier not null,
conversation_handle uniqueidentifier not null,
fragment_bitmap bigint not null,
fragment_size int not null,
message_enqueue_time datetime,
message_id uniqueidentifier not null,
message_sequence_number bigint not null,
message_type_id int not null,
next_fragment int not null,
priority tinyint not null,
queuing_order bigint identity (0, 1),
service_contract_id int not null,
service_id int not null,
status tinyint not null,
validation nchar(1) not null
)
go
create unique clustered index queue_clustered_index
on sys.queue_messages_1977058079 (status, priority, queuing_order, conversation_group_id, conversation_handle)
go
create unique index queue_secondary_index
on sys.queue_messages_1977058079 (status, priority, queuing_order, conversation_group_id, conversation_handle,
service_id)
go
create table sys.queue_messages_2009058193
(
binary_message_body varbinary(max),
conversation_group_id uniqueidentifier not null,
conversation_handle uniqueidentifier not null,
fragment_bitmap bigint not null,
fragment_size int not null,
message_enqueue_time datetime,
message_id uniqueidentifier not null,
message_sequence_number bigint not null,
message_type_id int not null,
next_fragment int not null,
priority tinyint not null,
queuing_order bigint identity (0, 1),
service_contract_id int not null,
service_id int not null,
status tinyint not null,
validation nchar(1) not null
)
go
create unique clustered index queue_clustered_index
on sys.queue_messages_2009058193 (status, priority, queuing_order, conversation_group_id, conversation_handle)
go
create unique index queue_secondary_index
on sys.queue_messages_2009058193 (status, priority, queuing_order, conversation_group_id, conversation_handle,
service_id)
go
create table sys.queue_messages_2041058307
(
binary_message_body varbinary(max),
conversation_group_id uniqueidentifier not null,
conversation_handle uniqueidentifier not null,
fragment_bitmap bigint not null,
fragment_size int not null,
message_enqueue_time datetime,
message_id uniqueidentifier not null,
message_sequence_number bigint not null,
message_type_id int not null,
next_fragment int not null,
priority tinyint not null,
queuing_order bigint identity (0, 1),
service_contract_id int not null,
service_id int not null,
status tinyint not null,
validation nchar(1) not null
)
go
create unique clustered index queue_clustered_index
on sys.queue_messages_2041058307 (status, priority, queuing_order, conversation_group_id, conversation_handle)
go
create unique index queue_secondary_index
on sys.queue_messages_2041058307 (status, priority, queuing_order, conversation_group_id, conversation_handle,
service_id)
go
create table sys.sqlagent_job_history
(
instance_id int identity,
job_id uniqueidentifier not null,
message nvarchar(4000),
operator_id_emailed int not null,
operator_id_paged int not null,
retries_attempted int not null,
run_date int not null,
run_duration int not null,
run_status int not null,
run_time int not null,
sql_message_id int not null,
sql_severity int not null,
step_id int not null
)
go
create unique clustered index sqlagent_job_history_clust
on sys.sqlagent_job_history (instance_id)
go
create index sqlagent_job_history_nc1
on sys.sqlagent_job_history (job_id)
go
create table sys.sqlagent_jobs
(
date_created datetime not null,
date_modified datetime not null,
delete_level int not null,
description nvarchar(512),
enabled bit not null,
job_id uniqueidentifier not null,
name sysname not null,
notify_level_eventlog bit not null,
start_step_id int not null
)
go
create unique clustered index sqlagent_jobs_clust
on sys.sqlagent_jobs (job_id)
go
create index sqlagent_jobs_nc1_name
on sys.sqlagent_jobs (name)
go
create table sys.sqlagent_jobsteps
(
additional_parameters nvarchar(max),
cmdexec_success_code int not null,
command nvarchar(max),
database_name sysname,
database_user_name sysname,
flags int not null,
job_id uniqueidentifier not null,
last_run_date int not null,
last_run_duration int not null,
last_run_outcome int not null,
last_run_retries int not null,
last_run_time int not null,
on_fail_action tinyint not null,
on_fail_step_id int not null,
on_success_action tinyint not null,
on_success_step_id int not null,
os_run_priority int not null,
output_file_name nvarchar(200),
retry_attempts int not null,
retry_interval int not null,
server sysname,
step_id int not null,
step_name sysname not null,
step_uid uniqueidentifier not null,
subsystem nvarchar(40) not null
)
go
create unique clustered index sqlagent_jobsteps_clust
on sys.sqlagent_jobsteps (job_id, step_id)
go
create unique index sqlagent_jobsteps_nc1
on sys.sqlagent_jobsteps (job_id, step_name)
go
create unique index sqlagent_jobsteps_nc2
on sys.sqlagent_jobsteps (step_uid)
go
create table sys.sqlagent_jobsteps_logs
(
date_created datetime not null,
log_id int identity,
log_text nvarchar(max) not null,
step_uid uniqueidentifier not null
)
go
create index sqlagent_jobsteps_logs_nc1
on sys.sqlagent_jobsteps_logs (step_uid, date_created)
go
create table sys.sysallocunits
(
auid bigint not null,
fgid smallint not null,
ownerid bigint not null,
pcdata bigint not null,
pcreserved bigint not null,
pcused bigint not null,
pgfirst binary(6) not null,
pgfirstiam binary(6) not null,
pgroot binary(6) not null,
status int not null,
type tinyint not null
)
go
create unique clustered index clust
on sys.sysallocunits (auid)
go
create unique index nc
on sys.sysallocunits (ownerid, type, auid)
go
create table sys.sysasymkeys
(
algorithm char(2) not null,
bitlength int not null,
encrtype char(2) not null,
id int not null,
modified datetime not null,
name sysname not null,
pkey varbinary(4700),
pukey varbinary(max) not null,
thumbprint varbinary(64) not null
)
go
create unique clustered index cl
on sys.sysasymkeys (id)
go
create unique index nc1
on sys.sysasymkeys (name)
go
create unique index nc3
on sys.sysasymkeys (thumbprint)
go
create table sys.sysaudacts
(
audit_spec_id int not null,
class tinyint not null,
grantee int not null,
id int not null,
state char not null,
subid int not null,
type char(4) not null
)
go
create unique clustered index clust
on sys.sysaudacts (class, id, subid, grantee, audit_spec_id, type)
go
create table sys.sysbinobjs
(
class tinyint not null,
created datetime not null,
id int not null,
intprop int not null,
modified datetime not null,
name sysname not null,
nsid int not null,
status int not null,
type char(2) not null
)
go
create unique clustered index clst
on sys.sysbinobjs (class, id)
go
create unique index nc1
on sys.sysbinobjs (class, nsid, name)
go
create table sys.sysbinsubobjs
(
class tinyint not null,
idmajor int not null,
intprop int not null,
name sysname not null,
status int not null,
subid int not null
)
go
create unique clustered index clst
on sys.sysbinsubobjs (class, idmajor, subid)
go
create unique index nc1
on sys.sysbinsubobjs (name, idmajor, class)
go
create table sys.sysbrickfiles
(
backuplsn binary(10),
brickid int not null,
createlsn binary(10),
dbid int not null,
diffbaseguid uniqueidentifier,
diffbaselsn binary(10),
diffbaseseclsn binary(10),
diffbasetime datetime not null,
droplsn binary(10),
fileguid uniqueidentifier,
fileid int not null,
filestate tinyint not null,
filetype tinyint not null,
firstupdatelsn binary(10),
forkguid uniqueidentifier,
forklsn binary(10),
forkvc bigint not null,
growth int not null,
grpid int not null,
internalstatus int not null,
lastupdatelsn binary(10),
lname sysname not null,
maxsize int not null,
pname nvarchar(260) not null,
pruid int not null,
readonlybaselsn binary(10),
readonlylsn binary(10),
readwritelsn binary(10),
redostartforkguid uniqueidentifier,
redostartlsn binary(10),
redotargetlsn binary(10),
size int not null,
status int not null
)
go
create unique clustered index clst
on sys.sysbrickfiles (dbid, pruid, fileid)
go
create table sys.syscerts
(
cert varbinary(max) not null,
encrtype char(2) not null,
id int not null,
issuer varbinary(884) not null,
lastpkeybackup datetime,
name sysname not null,
pkey varbinary(4700),
snum varbinary(32) not null,
status int not null,
thumbprint varbinary(64) not null
)
go
create unique clustered index cl
on sys.syscerts (id)
go
create unique index nc1
on sys.syscerts (name)
go
create unique index nc2
on sys.syscerts (issuer, snum)
go
create unique index nc3
on sys.syscerts (thumbprint)
go
create table sys.syschildinsts
(
crdate datetime not null,
iname sysname not null,
ipipename nvarchar(260) not null,
lsid varbinary(85) not null,
modate datetime not null,
pid int not null,
status int not null,
sysdbpath nvarchar(260) not null
)
go
create unique clustered index cl
on sys.syschildinsts (lsid)
go
create table sys.sysclones
(
cloneid int not null,
dbfragid int not null,
id int not null,
partid int not null,
rowsetid bigint not null,
segid int not null,
status int not null,
subid int not null,
version int not null
)
go
create unique clustered index clst
on sys.sysclones (id, subid, partid, version, segid, cloneid)
go
create table sys.sysclsobjs
(
class tinyint not null,
created datetime not null,
id int not null,
intprop int not null,
modified datetime not null,
name sysname not null,
status int not null,
type char(2) not null
)
go
create unique clustered index clst
on sys.sysclsobjs (class, id)
go
create unique index nc
on sys.sysclsobjs (name, class)
go
create table sys.syscolpars
(
chk int not null,
colid int not null,
collationid int not null,
dflt int not null,
id int not null,
idtval varbinary(64),
length smallint not null,
maxinrow smallint not null,
name sysname,
number smallint not null,
prec tinyint not null,
scale tinyint not null,
status int not null,
utype int not null,
xmlns int not null,
xtype tinyint not null
)
go
create unique clustered index clst
on sys.syscolpars (id, number, colid)
go
create unique index nc
on sys.syscolpars (id, name, number)
go
create table sys.syscommittab
(
commit_csn bigint not null,
commit_lbn bigint not null,
commit_time datetime not null,
commit_ts bigint not null,
dbfragid int not null,
xdes_id bigint not null
)
go
create unique clustered index ci_commit_ts
on sys.syscommittab (commit_ts, xdes_id)
go
create unique index si_xdes_id
on sys.syscommittab (xdes_id) include (dbfragid)
go
create table sys.syscompfragments
(
cprelid int not null,
datasize bigint not null,
fragid int not null,
fragobjid int not null,
itemcnt bigint not null,
rowcnt bigint not null,
status int not null,
ts binary(8) not null
)
go
create unique clustered index clst
on sys.syscompfragments (cprelid, fragid)
go
create table sys.sysconvgroup
(
id uniqueidentifier not null,
refcount int not null,
service_id int not null,
status int not null
)
go
create unique clustered index clst
on sys.sysconvgroup (id)
go
create table sys.syscscolsegments
(
base_id bigint not null,
column_id int not null,
container_id smallint,
data_ptr binary(16) not null,
encoding_type int not null,
hobt_id bigint not null,
magnitude float not null,
max_data_id bigint not null,
min_data_id bigint not null,
null_value bigint not null,
on_disk_size bigint not null,
primary_dictionary_id int not null,
row_count int not null,