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(CharNum, CharMessage)
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 208, Level 16, State 6, Procedure spInsertLobbyChat, Line 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'