CREATE PROCEDURE [dbo].[spInsertChatMessage] 
	@username	varchar(50),
	@message	text
AS
BEGIN
	INSERT INTO [tblChatMessages] (username, message) 
	VALUES (@username,@message);

	DELETE FROM [tblChatMessages] WHERE [id] NOT IN 
	(SELECT TOP 100 [id] FROM [tblChatMessages] ORDER BY [id] DESC);
END

