Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Not able to get the data into flat fille

$
0
0

Hello,

I been trying to pull the data from the table using SSIS but my package is failed on flat file. 

Step 1, Below script I been trying to run through stored procedure .

Step 2, I'm pulling through flat file but apparently getting failed at flat file using ( Select * from ChinaReport). 

is there another way I can pull the data using SSIS? 

ALTER PROCEDURE [dbo].[p_SendMail_China]

AS

BEGIN 

CREATE table ChinaReport
(
VendorCode varchar(6),
ItemNumber varchar(50),
ItemDescription varchar(max),
UOM varchar(6),
QtyReceived decimal(19,2),
QtyConsumed decimal(19,2)
)

DECLARE @FromDate DATETIME
DECLARE @ToDate DATETIME
SET @FromDate = (SELECT CAST(CONVERT(VARCHAR,DATEADD(MONTH,-1, GETDATE()),101) AS DATETIME))
SET @ToDate =  (SELECT CAST(CONVERT(VARCHAR,GETDATE(),101) AS DATETIME))

INSERT INTO ChinaReport
Select SUPLIER, ITEM, ITMDESC, STKUMID, dbo.f_GetQtyReceivedByDate(@FromDate, @ToDate, ITEM) as QtyReceived, 
ISNULL(dbo.f_GetQtyShippedByDate(@FromDate, @ToDate, ITEM),0) + ISNULL(dbo.f_GetQtyUsedByDate(@FromDate, @ToDate, ITEM),0) as QtyConsumed
From tblICITEM I
Where COUNTRYOFORIGIN = 'China'
And SUPLIER IS NOT NULL 
AND SUPLIER !=''

End

Thank you for guidance. 


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>