a very simple help please

Results 1 to 3 of 3
  1. #1
    Valued Member yona1006 is offline
    MemberRank
    Dec 2011 Join Date
    Valencia, VenezLocation
    130Posts

    smile a very simple help please

    hello peoples of RZ

    I spend a few problems recently
    whereby formatie the PC
    I lost so much information
    the thing I need is a query
    not a big deal but since my server
    and I need to add the user that are registered
    silk to test all things
    so I manually do the thing complicated
    as there are on record over 1500 accounts and last long
    so I ask the favor
    for someone to give me a query to add silk to all
    pls

    and sorry for the inconvenience
    excuse my English


  2. #2
    #Yummi.sql Caipi is offline
    MemberRank
    Sep 2011 Join Date
    GermanyLocation
    403Posts

    Re: a very simple help please

    PHP Code:
    Declare SilkCursor CURSOR
    FAST_FORWARD 
    FOR
    SELECT JID FROM TB_User

    OPEN SilkCursor

    Declare @CurJID INT,
            @
    Silk INT 5000; --> for 5k Silk

    FETCH NEXT FROM SilkCursor INTO 
    @CurJID

    WHILE @@FETCH_STATUS 0
        BEGIN
        
    IF exists (SELECT JID FROM SK_Silk WHERE JID = @CurJID)
            
    BEGIN
                UPDATE SK_Silk SET silk_own 
    += @Silk WHERE JID = @CurJID
            END
        
    ELSE
            
    BEGIN
                INSERT INTO SK_Silk SELECT 
    @CurJID, @Silk00
            END
        FETCH NEXT FROM SilkCursor INTO 
    @CurJID
        END
        
    CLOSE SilkCursor

    DEALLOCATE SilkCursor

    SELECT 
    'Done!' 

  3. #3
    Valued Member yona1006 is offline
    MemberRank
    Dec 2011 Join Date
    Valencia, VenezLocation
    130Posts

    Re: a very simple help please

    thx bro



Advertisement