decomp DBCServer_Release and inspect/document database
This commit is contained in:
parent
4b267cbe05
commit
7834b98bf0
28222 changed files with 843300 additions and 144 deletions
49
decomp/schema/RustyHearts_Log/procs/Local_CreateMCUTable.sql
Normal file
49
decomp/schema/RustyHearts_Log/procs/Local_CreateMCUTable.sql
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
CREATE PROCEDURE [dbo].[Local_CreateMCUTable]
|
||||
@createtime datetime
|
||||
as
|
||||
set nocount on
|
||||
|
||||
declare @year varchar(50)
|
||||
declare @month varchar(50)
|
||||
|
||||
set @year = convert(varchar, datepart(yy,@createtime))
|
||||
set @month = convert(varchar, datepart(mm,@createtime))
|
||||
|
||||
if OBJECT_ID( 'MCU_Log_'+ @year+'_'+@month ) IS NULL
|
||||
begin
|
||||
declare @br varchar(1500)
|
||||
set @br='CREATE TABLE MCU_Log_'+ @year+'_'+@month+
|
||||
'(
|
||||
[log_id] [bigint] IDENTITY(1,1) NOT NULL,
|
||||
[log_type] [smallint] NOT NULL,
|
||||
[world_id] [int] NOT NULL,
|
||||
[user_num] [int] NOT NULL DEFAULT (0),
|
||||
[date] [datetime] NOT NULL DEFAULT (getdate()),
|
||||
)'
|
||||
exec(@br)
|
||||
-----
|
||||
set @br='ALTER TABLE [dbo].[MCU_Log_'+ @year+'_'+ @month+'] WITH NOCHECK ADD
|
||||
CONSTRAINT [PK_log_id_MCU_Log_'+ @year+'_'+ @month+'] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[log_id] ASC
|
||||
) ON [PRIMARY]'
|
||||
exec(@br)
|
||||
-----
|
||||
set @br='CREATE NONCLUSTERED INDEX [IX_world_id_MCU_Log_'+ @year+'_'+ @month+'] ON [dbo].[MCU_Log_'+ @year+'_'+ @month+']
|
||||
(
|
||||
[world_id] ASC
|
||||
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]'
|
||||
exec(@br)
|
||||
-----
|
||||
set @br='CREATE NONCLUSTERED INDEX [IX_date_MCU_Log_'+ @year+'_'+ @month+'] ON [dbo].[MCU_Log_'+ @year+'_'+ @month+']
|
||||
(
|
||||
[date] ASC
|
||||
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]'
|
||||
exec(@br)
|
||||
-----
|
||||
set @br='CREATE NONCLUSTERED INDEX [IX_logtype_tem_Log_'+ @year+'_'+ @month+'] ON [dbo].[MCU_Log_'+ @year+'_'+ @month+']
|
||||
(
|
||||
[log_type] ASC
|
||||
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]'
|
||||
exec(@br)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue