Wednesday, March 21, 2012

Import e-mails into SQL Server database

This is a multi-part message in MIME format.
--=_NextPart_000_000C_01C513AD.9261A570
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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
--=_NextPart_000_000C_01C513AD.9261A570
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
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 belowALERT 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:FPCSegment:SAP_CCMS_fujipoc_FPC_01MTE:FPC\fujipoc_F= PC_01\R3Syslog\CCMSClient:000User:SAPSYSThe 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
--=_NextPart_000_000C_01C513AD.9261A570--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