Reklam Güncelleme Ücretleri { 01.06.2017 } Link

1298 için item bulma proc

'Prosedür & Query Kod Paylaşımları' forumunda TheSkyrM tarafından 21 Oca 2016 tarihinde açılan konu

Konu etiketleri:
  1. TheSkyrM

    TheSkyrM Banned

    [HIDE-REPLY]
    Kod:
    if exists (select * from sysobjects where id = object_id(N'[dbo].[itemler]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[itemler]
    
    if exists (select * from sysobjects where id = object_id(N'[dbo].[warehouse_itemler]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[warehouse_itemler]
    
    
    CREATE TABLE itemler
    (dwid int,
    stacksize smallint, 
    durability smallint, 
    strUserId varchar(50), 
    sira int ,
    itembasicname varchar(100))
    
    CREATE TABLE warehouse_itemler
    (dwid int,
    stacksize smallint, 
    durability smallint, 
    strUserId varchar(50), 
    sira int ,
    itembasicname varchar(100))
    
    
    
    Kod:
    --bu procedure Maktiris1536 tarafından eylenmiştir..
    
    --KO-Cuce.com 2008
    CREATE procedure itemleri_bul 
    @StrUserID varchar(30)
    AS
    DECLARE
    @length int, -- stritem uzunluğu
    @i int, -- item'in stritem deki yeri
    @dwid int, 
    @dur int,
    @duar int,
    @Kocuce int,
    @StackSize1 int,
    @Sira int,
    @Row int,
    @name varchar(100),
    @extname varchar(100),
    @ext int
    
    
        set @i = 14*0+1
        set @length = 401
    
    select @row=count(*) from userdata where struserid=@StrUserID
    
    delete from itemler where struserid=@StrUserID
    
    if @row>0 
      begin
    
    WHILE @i < @length
    Begin
    --Buraya İşemek Yasaktır
    Select @dwid=cast(cast(substring(cast(substring(strItem, @i,4) as varbinary(4)), 4, 1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 3, 1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 2, 1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 1, 1) as varbinary(4)) as int(4)),
    @dur = cast(cast(cast( substring(strItem, @i+5, 1) as varbinary(1))+cast(substring(strItem, @i+4, 1) as varbinary(1)) as varbinary(2)) as smallint),
    @StackSize1 = cast(cast(cast( substring(strItem, @i+7, 1) as varbinary(1))+cast(substring(strItem, @i+6, 1) as varbinary(1)) as varbinary(2)) as smallint),
            @StrUserID = strUserID
            From UserData
            Where strUserID = @StrUserID
    
    
    if @dwid=0 
    begin
    set @extname='~~~~~~ item yok ~~~~~~'
    set @name='~~~~~~ item yok ~~~~~~'
    end
    else
    begin
    set @extname='Bulunamadi'
    
    select @extname=strname from item where num=@dwid
    
    end
    
    insert into itemler (dwid,stacksize,durability,struserid,sira,itembasicname) values(@dwid,@stacksize1,@dur,@StrUserID,(@i-1) / 8,@extname )
    
    set @i=@i+8
    
    end
    
    select * from itemler where struserid=@StrUserID order by sira
    
    end
    GOKod:
    --bu procedure Maktiris1536 tarafından eylenmiştir..
    
    --KO-Cuce.com 2008
    CREATE procedure itemleri_bul_banka
    @StrUserID varchar(30)
    AS
    DECLARE
    @length int, -- stritem uzunluğu
    @i int, -- item'in stritem deki yeri
    @dwid int, 
    @dur int,
     @Kocuce int,
    @StackSize1 int,
    @Sira int,
    @Row int,
    @extname varchar(50)
    
    delete from warehouse_itemler where struserid=@StrUserID
    
        set @i = 14*0+1
        set @length=1601
    
    select @row=count(*) from warehouse where straccountid=@StrUserID
    
    if @row>0 
      begin
    
    WHILE @i < @length
    Begin
    
    --Buraya İşemek Yasaktır
    Select @dwid=cast(cast(substring(cast(substring(WarehouseData, @i,4) as varbinary(4)), 4, 1)+substring(cast(substring(WarehouseData, @i,4) as varbinary(4)), 3, 1)+substring(cast(substring(WarehouseData, @i,4) as varbinary(4)), 2, 1)+substring(cast(substring(WarehouseData, @i,4) as varbinary(4)), 1, 1) as varbinary(4)) as int(4)),
    @dur = cast(cast(cast( substring(WarehouseData, @i+5, 1) as varbinary(1))+cast(substring(WarehouseData, @i+4, 1) as varbinary(1)) as varbinary(2)) as smallint),
    @StackSize1 = cast(cast(cast( substring(WarehouseData, @i+7, 1) as varbinary(1))+cast(substring(WarehouseData, @i+6, 1) as varbinary(1)) as varbinary(2)) as smallint),
            @StrUserID = straccountid
            From warehouse
            Where straccountid = @StrUserID
    
    if @dwid=0 
    begin
    set @extname='~~~~~~ item yok ~~~~~~'
    end
    else
    begin
    set @extname='Bulunamadı'
    
    select @extname=strname from item where num=@dwid
    end
    
    insert into warehouse_itemler values(@dwid,@stacksize1,@dur,@StrUserID,(@i-1) / 8,@extname )
    
    set @i=@i+8
    
    end
    
    select * from warehouse_itemler where struserid=@StrUserID order by sira
    
    end
    GOKod:
    --bu procedure Maktiris1536 tarafından eylenmiştir..
    
    
    CREATE procedure itemleri_encode
    @StrUserID varchar(30)
    AS
    DECLARE
    @length int, -- stritem uzunluğu
    @row int, -- yerine göre deişior.
    @i int, -- item'in stritem deki yeri
    @dwid int, -- dwid
    @pos int,
    @dur int,
    @dur1 int,
     @Kocuce int,
    @ext int,
    @StackSize1 int,
    @strName varchar(30),
    @strExtName varchar(30),
    @Cdwid varbinary(4),
    @cdur varchar(2),
    @Source tinyint,
    @NEWdwid int,
    @StackSize int,
    @cstack varchar(2),
    @sira int
    
        set @sira=0
        set @i = 14*0
        set @length = 401
    
    select @row=count( * ) from userdata where struserid=@StrUserID
    
    if @row>0 
      begin
    
    
    Select @dwid=dwid,
    @dur = durability,
    @StackSize1 = stacksize,
            @StrUserID = strUserID
            From itemler
            Where strUserID = @StrUserID and sira=@sira
    
        Set @Cdwid = Substring(cast(@dwid as varbinary(4)), 4, 1) + Substring(cast(@dwid as varbinary(4)), 3, 1) + Substring(cast(@dwid as varbinary(4)), 2, 1) + Substring(cast(@dwid as varbinary(4)), 1, 1)
        Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as varchar(2))
        Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as varbinary(2)), 1, 1) as varchar(2))
    
    
        update UserData set strItem = cast(cast(cast(@Cdwid as varchar(4)) + @Cdur + @Cstack as varchar(8))   as binary(400)) where strUserID = @strUserID
    
    
    set @i=@i+8
    set @sira=@sira+1
    
    
    
    WHILE @sira < 50
    Begin
    
    Select @dwid=dwid,
    @dur = durability,
    @StackSize1 = stacksize,
            @StrUserID = strUserID
            From itemler
            Where strUserID = @StrUserID and sira=@sira
    
        Set @Cdwid = Substring(cast(@dwid as varbinary(4)), 4, 1) + Substring(cast(@dwid as varbinary(4)), 3, 1) + Substring(cast(@dwid as varbinary(4)), 2, 1) + Substring(cast(@dwid as varbinary(4)), 1, 1)
        Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as varchar(2))
        Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as varbinary(2)), 1, 1) as varchar(2))
    
    
    --KO-Cuce.com 2008
    
        update UserData set strItem = cast( substring(strItem, 1, @i) + cast(cast(@Cdwid as varchar(4)) + @Cdur + @Cstack as varchar(8)) + substring(strItem, @i+8, 401-@i) as binary(400)) where strUserID = @strUserID
    
     --Buraya İşemek Yasaktır
    
    set @i=@i+8
    set @sira=@sira+1
    
    end
    end
    GOKod:
    --KO-Cuce.com 2008
     --Buraya İşemek Yasaktır
    
    --bu procedure Maktiris1536 tarafyndan eylenmi?tir..
    
    
    CREATE procedure itemleri_encode_banka
    @StrUserID varchar(30)
    AS
    DECLARE
    @length int, -- stritem uzunlu?u
    @row int, -- yerine göre dei?ior.
    @i int, -- item'in stritem deki yeri
    @dwid int, -- dwid
    @pos int,
    @dur int,
     @Kocuce int,
    @dur1 int,
    @ext int,
    @StackSize1 int,
    @strName varchar(30),
    @strExtName varchar(30),
    @Cdwid varbinary(4),
    @cdur varchar(2),
    @Source tinyint,
    @NEWdwid int,
    @StackSize int,
    @cstack varchar(2),
    @sira int,
    @Warehousedata varchar(1601)
    
        set @sira=0
        set @i = 14*0
        set @length = 1601
    
    select @row=count( * ) from warehouse where straccountid=@StrUserID
    
    if @row>0 
      begin
    
    Select @dwid=dwid,
    @dur = durability,
    @StackSize1 = stacksize,
            @StrUserID = struserid
            From warehouse_itemler
            Where struserid = @StrUserID and sira=@sira
    
        Set @Cdwid = Substring(cast(@dwid as varbinary(4)), 4, 1) + Substring(cast(@dwid as varbinary(4)), 3, 1) + Substring(cast(@dwid as varbinary(4)), 2, 1) + Substring(cast(@dwid as varbinary(4)), 1, 1)
        Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as varchar(2))
        Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as varbinary(2)), 1, 1) as varchar(2))
    
    
    set @WarehouseData= cast(cast(cast(@Cdwid as varchar(4)) + @Cdur + @Cstack as varchar(8))   as binary(400)) 
        --update warehouse set WarehouseData = cast(cast(cast(@Cdwid as varchar(4)) + @Cdur + @Cstack as varchar(8))   as binary(400)) where straccountid = @strUserID
    
    
    set @i=@i+8
    set @sira=@sira+1
    
    
    
    WHILE @i<@length
    Begin
    print @sira
    Select @dwid=dwid,
    @dur = durability,
    @StackSize1 = stacksize,
            @StrUserID = struserid
            From warehouse_itemler
            Where struserid = @StrUserID and sira=@sira
    
        Set @Cdwid = Substring(cast(@dwid as varbinary(4)), 4, 1) + Substring(cast(@dwid as varbinary(4)), 3, 1) + Substring(cast(@dwid as varbinary(4)), 2, 1) + Substring(cast(@dwid as varbinary(4)), 1, 1)
        Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as varchar(2))
        Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as varbinary(2)), 1, 1) as varchar(2))
    
    set @Warehousedata=cast( substring(@WarehouseData, 1, @i) + cast(cast(@Cdwid as varchar(4)) + @Cdur + @Cstack as varchar(8)) + substring(@WarehouseData, @i+8, 1601-@i) as binary(400))
    --    update warehouse set WarehouseData = cast( substring(WarehouseData, 1, @i) + cast(cast(@Cdwid as varchar(4)) + @Cdur + @Cstack as varchar(8)) + substring(WarehouseData, @i+8, 1601-@i) as binary(400)) where straccountid = @strUserID
    
    
    set @i=@i+8
    set @sira=@sira+1
    
    end
    
        update warehouse set WarehouseData = @WarehouseData where straccountid = @strUserID
    
    end
    GO
    kullanım :
    
    exec itemleri_bul 'id'
    exec itemleri_bul_banka 'accountid'
    
    eğer enterprisemanagere girerseniz direk char editleyebilirsiniz.
    
    kayıt için de :
    
    exec itemleri_encode 'id'
    exec itemleri_encode_banka 'accountid'
    
    [/HIDE-REPLY]
     
  2. xaryc

    xaryc Üye

    teşekkürler
     

Bu Sayfayı Paylaş