New SQL Table

Results 1 to 4 of 4
  1. #1
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    config New SQL Table

    Source Edit:
    Code:
    TCHAR g_szDB_LOBBY_CHAT[] = _T("{CALL spInsertLobbyChat ('%s', '%s')}");
    
    bool MMatchDBMgr::LobbyChat(const TCHAR* szName, const char* szMsg) 
    {
    	_STATUS_DB_START;
    	if (!CheckOpen()) return false;
    
    	CString strSQL;
    
    	try {
    		strSQL.Format( g_szDB_LOBBY_CHAT, szName, szMsg );
    		m_DB.ExecuteSQL( strSQL );
    	} 
    	catch(CDBException* e) {
    
    		ExceptionHandler(strSQL, e);
    		return false;
    	}
    	_STATUS_DB_END(12);
    	return true;
    }
    Code:
    m_MatchDBMgr.LobbyChat(pObj->GetCharInfo()->m_szName, pszChat);
    SQL Edit:
    GunzDB->Programmability->Stored Procedures (Right Click -New Stored Procedure...)
    PHP Code:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    ALTER PROC 
    [dbo].[spInsertLobbyChat]
    @
    CharNum     smallint,
    @
    CharMessage varchar(MAX)
    AS  
    SET NOCOUNT ON 
    INSERT INTO LobbyChat
    (CharNumCharMessage)  
    VALUES(@CharNum, @CharMessage
    Save as spInsertLobbyChat.sql

    Following Errors:
    1) Doesn't add into the Stored Procedures Folder after i save.
    2) I tryed to 'Execute' into GunzDB and had this error:
    PHP Code:
    Msg 208Level 16State 6Procedure spInsertLobbyChatLine 6
    Invalid object name 
    'dbo.spInsertLobbyChat'
    I just need to make this thing and then add table in order to work, any help by correcting the code in 'spInsertLobbyChat.sql' would be good and tell me how to add the Table and make it connect to 'spInserLobbyChat.sql'
    Last edited by qet123; 17-11-12 at 02:43 PM.


  2. #2
    Developer / Patch Finder Tankado is offline
    MemberRank
    Oct 2011 Join Date
    The NetherlandsLocation
    451Posts

    Re: New SQL Table

    first,
    make sure there is a table named like "spInserLobbyChat" (i dont tink so)

    Spoiler:


    PHP Code:

    USE [GunzDB]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE 
    [dbo].[LobbyChat](
        [
    ID] [intIDENTITY(1,1NOT NULL,
        [
    CharName] [varchar](50NOT NULL,
        [
    CharMessage] [textNOT NULL
    ON [PRIMARY]

    GO
    SET ANSI_PADDING OFF
    INSERT INTO LobbyChat 
    (CharNameCharMessageVALUES ('Tankado''George is noooooooob'
    Coded Writed by Tankado ( coded for George )


    Dont look at my insert :P
    Last edited by Tankado; 17-11-12 at 06:31 PM.

  3. #3
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    Re: New SQL Table

    Quote Originally Posted by Tankado View Post
    first,
    make sure there is a table named like "spInserLobbyChat" (i dont tink so)
    Thanks for You and Omar(Vusion) for fixing my problem, i won't edit the post in order to make people take idea how to add new table and storing it... Bye

  4. #4
    Developer / Patch Finder Tankado is offline
    MemberRank
    Oct 2011 Join Date
    The NetherlandsLocation
    451Posts

    Re: New SQL Table

    George, If u change this thread (small)
    than can u move this as a GUID



Advertisement