Wednesday, March 21, 2012

Import e-mails into SQL Server database

Hi,
I need to import/extract information from E-mails delivered to my SQL Server 2000 mail account.
The format of the e-mail is as below
ALERT for FPC \ fujipoc_FPC_01 \ R3Syslog \ CCMS at 20040916 074903 ( Time in UTC ) Yellow CCMS alert for monitored object CCMS Alert Text:The active profile was modified System:FPC
Segment:SAP_CCMS_fujipoc_FPC_01
MTE:FPC\fujipoc_FPC_01\R3Syslog\CCMS
Client:000
User:SAPSYS
The information I want to capture is underlined, the text file is not standard in width as there are many different monitors.
Is there an easy way to pull this information into the SQL table, I know that I can use format files with BCP but what about DTS packages?
TIA
Chris aka BoobBoo
Hi
You may want to look at xp_findnextmsg and xp_readmail to read the mailbox
directly. You can then use string functions to parse the message.
John
"Chris Kernaghan" wrote:

> Hi,
> I need to import/extract information from E-mails delivered to my SQL Server 2000 mail account.
> The format of the e-mail is as below
> ALERT for FPC \ fujipoc_FPC_01 \ R3Syslog \ CCMS at 20040916 074903 ( Time in UTC ) Yellow CCMS alert for monitored object CCMS Alert Text:The active profile was modified System:FPC
> Segment:SAP_CCMS_fujipoc_FPC_01
> MTE:FPC\fujipoc_FPC_01\R3Syslog\CCMS
> Client:000
> User:SAPSYS
>
> The information I want to capture is underlined, the text file is not standard in width as there are many different monitors.
> Is there an easy way to pull this information into the SQL table, I know that I can use format files with BCP but what about DTS packages?
>
> TIA
> Chris aka BoobBoo

No comments:

Post a Comment