Shezad Ahmed
asked on
Extract email message from SQL iMAGE Column file
HI
I have uploaded an outlook email message to SQL using:
Column type is 'image'.
UPDATE dbo.AMGR_Letters_Tbl
SET TextCol = (SELECT *
FROM OPENROWSET(BULK 'C:\test\test.msg',
SINGLE_BLOB) AS x)
WHERE Sequence_Number = 182
Now I want to extract the same file as an outlook email message.
Code I used:
DECLARE @Command NVARCHAR(4000)
SET @Command = 'bcp "SELECT TextCol FROM EsconaTutorial.dbo.AMGR_Le tters_Tbl WHERE Sequence_Number = 182" queryout "C:\Test\TEXT.msg" -T -n -S127.0.0.1'
PRINT @Command -- debugging
EXEC xp_cmdshell @Command
GO
I am unable to open the extracted file .
I get "The file may not exist, you may not have permission to open it.
Thanks,
Shezad
I have uploaded an outlook email message to SQL using:
Column type is 'image'.
UPDATE dbo.AMGR_Letters_Tbl
SET TextCol = (SELECT *
FROM OPENROWSET(BULK 'C:\test\test.msg',
SINGLE_BLOB) AS x)
WHERE Sequence_Number = 182
Now I want to extract the same file as an outlook email message.
Code I used:
DECLARE @Command NVARCHAR(4000)
SET @Command = 'bcp "SELECT TextCol FROM EsconaTutorial.dbo.AMGR_Le
PRINT @Command -- debugging
EXEC xp_cmdshell @Command
GO
I am unable to open the extracted file .
I get "The file may not exist, you may not have permission to open it.
Thanks,
Shezad
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.