January 20, 2004 at 10:49 am
Hello all,
How can I save the results from xp_readmail to a table? Some tsql examples would be very helpful. Thanks in advance.
-Isaiah
January 20, 2004 at 11:55 am
It's a stored procedure, so an insert..exec will do it
create table mytest( drive varchar(2), mb numeric)
insert mytest exec master..xp_fixeddrives
select * from mytest
drop table mytest
January 20, 2004 at 12:19 pm
Thanks Steve!
Here's what it looks like just to test out. I can think of a few ways to put this to use...
CREATE TABLE [dbo].[Email] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Originator] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Date Received] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Recipients] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CC List] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[BCC List] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Subject] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Message] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Unread] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Attachments] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Message ID] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Type] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
insert email exec master..xp_readmail
select * from email
--drop table email
-Isaiah
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply