CREATE PROCEDURE [dbo].[up_SetPvpResult] @log_type smallint, @auth_id uniqueidentifier, @bcust_id nvarchar(24), @character_id uniqueidentifier, @character_name nvarchar(16), @character_class int, @character_level int, @channel_type int, @room_id uniqueidentifier, @room_world int, @room_type int, @room_map int, @pvp_team smallint, @pvp_score int, @pvp_point int, @pvp_grade int, @pvp_totalscore int, @pvp_totalpoint int, @pvp_rank int, @pvp_kill int, @pvp_die int, @pvp_damage int, @pvp_cleartime int as set nocount on declare @createtime datetime set @createtime = getdate() declare @year varchar(50) declare @month varchar(50) set @year = convert(varchar, datepart(yy,@createtime)) set @month = convert(varchar, datepart(mm,@createtime)) set xact_abort on begin tran declare @updatesql nvarchar(1500) declare @char_auth_id nvarchar(50) declare @char_character_id nvarchar(50) declare @char_pvp_room_id nvarchar(50) set @char_auth_id = @auth_id set @char_character_id = @character_id set @char_pvp_room_id = @room_id -- Battle_Room_Log ??? ?? exec Local_CreatePvpResultTable @createtime SET @updatesql ='insert into Pvp_Result_Log_'+ @year+'_' +@month+'(log_type, auth_id, bcust_id, character_id, character_name, character_class, character_level, channel_type, room_id, room_world, room_type, PZoneID, pvp_team, pvp_score, pvp_point, pvp_grade, pvp_totalscore, pvp_totalpoint, pvp_rank, pvp_kill, pvp_die, pvp_damage, pvp_cleartime, date ) values (' + '''' +convert(nvarchar, @log_type) + '''' + ',' + '''' +@char_auth_id + '''' + ',' + '''' +@bcust_id + '''' + ',' + '''' +@char_character_id + '''' + ',' + '''' +@character_name + '''' + ',' + '''' +convert(nvarchar, @character_class)+ '''' + ',' + '''' +convert(nvarchar, @character_level)+ '''' + ',' + '''' +convert(nvarchar, @channel_type)+ '''' + ',' + '''' +@char_pvp_room_id + '''' + ',' + '''' +convert(nvarchar, @room_world) + '''' + ',' + '''' +convert(nvarchar, @room_type) + '''' + ',' + '''' +convert(nvarchar, @room_map) + '''' + ',' + '''' +convert(nvarchar, @pvp_team) + '''' + ',' + '''' +convert(nvarchar, @pvp_score) + '''' + ',' + '''' +convert(nvarchar, @pvp_point) + '''' + ',' + '''' +convert(nvarchar, @pvp_grade) + '''' + ',' + '''' +convert(nvarchar, @pvp_totalscore)+ '''' + ',' + '''' +convert(nvarchar, @pvp_totalpoint)+ '''' + ',' + '''' +convert(nvarchar, @pvp_rank) + '''' + ',' + '''' +convert(nvarchar, @pvp_kill) + '''' + ',' + '''' +convert(nvarchar, @pvp_die) + '''' + ',' + '''' +convert(nvarchar, @pvp_damage) + '''' + ',' + '''' +convert(nvarchar, @pvp_cleartime)+ '''' + ',' + '''' +convert(nvarchar, @createtime, 109)+ '''' + ')' EXEC(@updatesql) if(@@error <> 0) begin rollback return end commit