Creating new account error in SQL 2016 Windows 10 x64

Results 1 to 6 of 6
  1. #1
    Enthusiast razvikennedy is offline
    MemberRank
    Jun 2010 Join Date
    43Posts

    sad Creating new account error in SQL 2016 Windows 10 x64

    Database always gives me this error Msg 8152, Level 16, State 11, Procedure cabal_tool_registerAccount, Line 6 [Batch Start Line 0]
    String or binary data would be truncated.
    Tried anything, xp_md5, changing codes, etc. not working.
    I read all forum posts about this issue. Can someone help me fix it?

    Windows 10 x64, sql 2016. (tried on sql 2008, 2014 - still not working)


  2. #2
    UtakAso Drav3n is offline
    MemberRank
    Aug 2011 Join Date
    PHLocation
    919Posts

    Re: Creating new account error in SQL 2016 Windows 10 x64

    Copy these and insert it on your procedure

    USE [ACCOUNT]
    GO
    /****** Object: StoredProcedure [dbo].[cabal_tool_registerAccount] Script Date: 8/10/2016 12:48:16 AM ******/
    /****** Fixed by: Drav3n *****/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[cabal_tool_registerAccount] (@id varchar(32), @password varchar(32))
    AS
    begin tran
    declare @UserNum as int

    insert into cabal_auth_table( ID, Password, Login, AuthType, IdentityNo)
    values(@id, pwdencrypt(@password), '0', 1, '7700000000000')

    set @UserNum = @@identity


    insert into cabal_charge_auth(usernum, type, expiredate, payminutes)
    values(@UserNum, 0, DATEADD(day, 1000, getdate()), 0)

    INSERT INTO [CabalCash].[dbo].[CashAccount] ([ID], [UserNum], [Cash], [CashBonus])
    VALUES (@id, @UserNum, '0', '0')

    select @UserNum as usernum
    commit

  3. #3
    Enthusiast razvikennedy is offline
    MemberRank
    Jun 2010 Join Date
    43Posts

    Re: Creating new account error in SQL 2016 Windows 10 x64

    Still Msg 8152, Level 16, State 11, Procedure cabal_tool_registerAccount, Line 6 [Batch Start Line 0]
    String or binary data would be truncated.
    ... Not working. :(

  4. #4
    UtakAso Drav3n is offline
    MemberRank
    Aug 2011 Join Date
    PHLocation
    919Posts

    Re: Creating new account error in SQL 2016 Windows 10 x64

    What tool or query you are using to register an account?

  5. #5
    Enthusiast razvikennedy is offline
    MemberRank
    Jun 2010 Join Date
    43Posts

    Re: Creating new account error in SQL 2016 Windows 10 x64

    I'm using the Account SQL Query from Microsoft SQL Server Management Studio 2016. Idk what to answer to that question.
    Last edited by razvikennedy; 10-08-16 at 12:29 AM.

  6. #6
    Enthusiast razvikennedy is offline
    MemberRank
    Jun 2010 Join Date
    43Posts

    Re: Creating new account error in SQL 2016 Windows 10 x64

    SOLVED!!! Just change the design of password column from varbinary(50) to varbinary(100)
    Last edited by razvikennedy; 10-08-16 at 03:09 AM.



Advertisement