ImSoRy Moderatör
Mesaj Sayısı : 56 Başarı Puanı : 234 Rep Puanı : 0 Bölümü : Oyunlar / Webmaster
| Konu: [Paylaşım] Sorusnuz NATION_SELECT Prosedürü! Yeni Güncel! Ptsi Tem. 12, 2010 5:56 am | |
| Artık Bu İşlerede Bulaştım Hadi Bakalım
- Kod:
-
-- Created by Samma -- GÜNCELLEME : DONTE -- 21.10.2009
CREATE PROCEDURE NATION_SELECT @nRet smallint OUTPUT, @AccountID char(21), @Nation tinyint AS
DECLARE @Row tinyint SET @Row = 0
strAccountID = @AccountID
BEGIN TRAN
SELECT @Row = COUNT(*) FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID IF @Row > 0 UPDATE ACCOUNT_CHAR SET bNation = @Nation WHERE strAccountID = @AccountID ELSE INSERT INTO ACCOUNT_CHAR (strAccountID, bNation ) VALUES (@AccountID, @Nation)
SELECT @Row = COUNT(*) FROM WAREHOUSE WHERE strAccountID = @AccountID IF @Row = 0 INSERT INTO WAREHOUSE ( strAccountID ) VALUES (@AccountID)
IF @@ERROR <> 0 BEGIN ROLLBACK TRAN SET @nRet = -2 RETURN END COMMIT TRAN SET @nRet = 1
GO
[SIZE="4"]Orjinali [/SIZE]
- Kod:
-
/****** Object: Stored Procedure dbo.NATION_SELECT script Date: 6/6/2006 6:03:33 PM ******/
-- Created by Samma -- 2002.01.18
CREATE PROCEDURE NATION_SELECT @nRet smallint OUTPUT, @AccountID char(21), @Nation tinyint AS
DECLARE @Row tinyint SET @Row = 0
SELECT @Row = COUNT(*) FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID IF @Row > 0 BEGIN SET @nRet = -1 RETURN END
BEGIN TRAN
SELECT @Row = COUNT(*) FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID IF @Row > 0 UPDATE ACCOUNT_CHAR SET bNation = @Nation WHERE strAccountID = @AccountID ELSE INSERT INTO ACCOUNT_CHAR (strAccountID, bNation ) VALUES (@AccountID, @Nation)
SELECT @Row = COUNT(*) FROM WAREHOUSE WHERE strAccountID = @AccountID IF @Row = 0 INSERT INTO WAREHOUSE ( strAccountID ) VALUES (@AccountID)
END COMMIT TRAN SET @nRet = 1
GO
İyi Kullanmalar | |
|