There are a lot of ways to do this...but here is one idea. I suggest taking a look at Sonork.
www.sonork.comYou get the soure code & it can use SQL Server as a backend for all the logging.
>Hi,
>
>I have a client that would like a "Station to Station Messaging"
>system. Their are about 10 stations on the Local Area Network.
>He would like an application that would allow one station to
>send a message to another station. A popup window would open
>when a station received a message showing who the message was
>from and the level of urgency. He would like these messages
>to be logged into a database.
>
>Do you know where we can get an application like this?
>
>Thanks,
>Terry Harris
ICQ 10556 (ya), 254117