02-02-2017, 02:43 AM
|
#3
|
|
• الانـتـسـاب » Apr 2015
|
• رقـم العـضـويـة » 121546
|
• المشـــاركـات » 4,029
|
• الـدولـة » https://t.me/pump_upp
|
• الـهـوايـة » MIS
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 45
|
|
|
رد: بخصوص ال union
اعمل دول
كود:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_AllianceCreate] Script Date: 2/2/2017 1:40:49 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[_AllianceCreate]
@CreatorGuildID int,
@FirstAllyGuildID int
AS
set xact_abort on
begin transaction
declare @AllianceID int
set @AllianceID = 0
Insert into _AlliedClans values(@CreatorGuildID,@FirstAllyGuildID,0,0,0,0,0,0,GetDate(),0,0)
if (@@error <> 0 or @@rowcount = 0)
begin
rollback transaction
return -1
end
set @AllianceID = @@identity
if( @AllianceID = 0 )
begin
rollback transaction
return -2
end
update _Guild set Alliance = @AllianceID where id in (@CreatorGuildID, @FirstAllyGuildID)
if( @@error <> 0 or @@rowcount <> 2 )
begin
rollback transaction
return -3
end
commit transaction
return @AllianceID
كود:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_AllianceRemove] Script Date: 2/2/2017 1:41:44 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-------------------------------------------------------------
ALTER PROCEDURE [dbo].[_AllianceRemove]
@AllianceID int
AS
if( not exists( select id from _AlliedClans where id = @AllianceID ) )
begin
return 0
end
set xact_abort on
begin transaction
--ى¼ë‹¨ ى†Œى†چ 길드부ي„° ê°•ى*œ يƒˆي‡´ë‹¤!
update _Guild set Alliance = 0 where Alliance = @AllianceID
if (@@error <> 0 or @@rowcount = 0)
begin
rollback transaction
return 0
end
--ëڈ™ë§¹ ë‚*린다
delete _AlliedClans where id = @AllianceID
if (@@error <> 0 or @@rowcount = 0)
begin
rollback transaction
return 0
end
commit transaction
return 1
|
|
|