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
70
decomp/schema/RustyHearts/procs/up_insert_mail.sql
Normal file
70
decomp/schema/RustyHearts/procs/up_insert_mail.sql
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
CREATE PROCEDURE [dbo].[up_insert_mail]
|
||||
@sender_auth_id [uniqueidentifier],
|
||||
@sender_character_id [uniqueidentifier],
|
||||
@sender_name nvarchar(16),
|
||||
@recver_name nvarchar(16),
|
||||
@msg nvarchar(100),
|
||||
@money int,
|
||||
@return_day int,
|
||||
@req_money int,
|
||||
@NewMailID [uniqueidentifier],
|
||||
@createType int
|
||||
|
||||
|
||||
as
|
||||
set nocount on
|
||||
|
||||
declare @character_id [uniqueidentifier]
|
||||
set @character_id = NULL
|
||||
|
||||
begin tran
|
||||
|
||||
select @character_id = [character_id] from CharacterTable with (READUNCOMMITTED) where [Name] = @recver_name
|
||||
|
||||
if @character_id IS NULL
|
||||
begin
|
||||
insert into MailTable
|
||||
values
|
||||
( @NewMailID, --0
|
||||
@sender_character_id, --1
|
||||
@recver_name, --2
|
||||
@sender_character_id, --3
|
||||
@sender_name, --4
|
||||
@msg, --3
|
||||
@money, --4
|
||||
@return_day,
|
||||
@req_money,
|
||||
0, --8
|
||||
GETDATE(),
|
||||
16
|
||||
);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
insert into MailTable
|
||||
values
|
||||
( @NewMailID, --0
|
||||
@character_id, --1
|
||||
@recver_name, --2
|
||||
@sender_character_id, --3
|
||||
@sender_name, --4
|
||||
@msg, --3
|
||||
@money, --4
|
||||
@return_day,
|
||||
@req_money,
|
||||
0, --8
|
||||
GETDATE(),
|
||||
@createType
|
||||
);
|
||||
end
|
||||
|
||||
declare @ERR int
|
||||
|
||||
SET @ERR = @@ERROR
|
||||
IF @ERR <> 0 BEGIN
|
||||
RAISERROR('처리오류', 16, 10)
|
||||
IF @@TRANCOUNT <> 0 ROLLBACK
|
||||
RETURN (@ERR)
|
||||
END
|
||||
COMMIT TRAN
|
||||
Loading…
Add table
Add a link
Reference in a new issue