[CN - 2012] dbo.tMinorsPlaytime

Results 1 to 6 of 6
  1. #1
    Apprentice DentalFloss is offline
    MemberRank
    Jul 2015 Join Date
    15Posts

    [CN - 2012] dbo.tMinorsPlaytime

    Anyway to turn it off beside manually adding someone to it?


  2. #2
    Member hannesa is offline
    MemberRank
    Apr 2013 Join Date
    87Posts

    Re: [CN - 2012] dbo.tMinorsPlaytime

    Yes.
    One of the easiest way to bypass this should be to alter the usp_China_getMinorsPlaytime procedure like this:
    Code:
    ALTER PROCEDURE [dbo].[usp_China_getMinorsPlaytime]
        @NuserNo int
    ,    @nRet    int = 0 output
    AS
    BEGIN
        SET NOCOUNT ON
        
        DECLARE @isAdult    bit = 1
        DECLARE @playtime   bigint = 0
    /*    DECLARE @logoutDate datetime
        
        SET @nRet = 0
        
        SELECT @isAdult = bIsAdult, @playtime = nPlaytime, @logoutDate = dLogoutDate 
          FROM tMinorsPlaytime WITH(UPDLOCK, HOLDLOCK)
         WHERE nUserNo = @NuserNo
        IF @logoutDate IS NULL OR DATEADD(hour, 5, @logoutDate) <= GETDATE() BEGIN
            BEGIN TRAN
            
            SET @playtime = 0
            
            UPDATE tMinorsPlaytime 
               SET nPlaytime = @playtime
             WHERE nUserNo = @NuserNo
            IF @@ERROR <> 0 OR @@ROWCOUNT <> 1 BEGIN
                ROLLBACK TRAN
                SET @nRet = -1111
                RETURN
            END
            
            COMMIT TRAN
        END    */
        
        SELECT @isAdult AS bIsAdult, @playtime AS nPlaytime
    END
    But really, why you should disable it, why not simply use the given procedures to create a new User and automatically add those rows/values?
    There are many predefined stored procedures to do all the tasks you need to do.
    Last edited by hannesa; 25-09-15 at 10:46 AM.

  3. #3
    ExtrinsicStudio™ Myth is offline
    MemberRank
    Jan 2012 Join Date
    367Posts

    Re: [CN - 2012] dbo.tMinorsPlaytime

    I'll be a nice guy today (good mood) and give you the low-down on the easier solution, aka SELECT 1, 0 use above but scrap everything and simply return with pre-defined data, saves tables/space in your database.



    Tl;dr: Edit this to SELECT 1, 0

  4. #4
    Member hannesa is offline
    MemberRank
    Apr 2013 Join Date
    87Posts

    Re: [CN - 2012] dbo.tMinorsPlaytime

    Yes youre right but i thought that could be easier to learn from (maybe not).

  5. #5
    Apprentice DentalFloss is offline
    MemberRank
    Jul 2015 Join Date
    15Posts

    Re: [CN - 2012] dbo.tMinorsPlaytime

    Thanks for all your help!

  6. #6
    əʇılə ɯɐ ı fiestanerd69 is offline
    MemberRank
    Jun 2009 Join Date
    958Posts

    Re: [CN - 2012] dbo.tMinorsPlaytime

    Closing this thread seeing as the issue has been resolved. @DentalFloss please use the thanks button next time.



Advertisement