Hi,
Is it possible to create a dynamic excel file (destination) ?
I trired the below steps but it is giving the following error:
1--In data flow, drag OLEDB Source, then select data access mode as SQL Command, in pane Write EXEC dbo.YOURPROCNAME, On top you have to select the connection to your database.
2--Now you would have all the records, Drage Excel Destination. Connect them and then create Excel Connection manger by using Wizard. Define where you want to put the file.
3--Creat a variable called ExcelFileName. get the properties of this variable, It will be string type variable. In properties you will see Expressions.. you need to writte the expression here, how you want the name.
Your expression would be something like this... "D:\\MyFolder\\MyExcelFiles\\Report_"(DT_STR,1252)(getdate()... this is just an example you have to replace . with _ in expression, Here is linke , how to create timestamp with file name
--Edited:
Expression Script
"D:\\MyExcelFolder\\report_"+Replace(Replace(Replace(Replace((DT_WSTR,50)(getdate()),"-","")," ","_"),":",""),".","_")+".xls"
output will be like this D:\MyExcelFolder\report_20100624_145946_836000000.xls
You can change according to your requirement.
http://consultingblogs.emc.com/jamiethomson/archive/2007/02/07/SSIS-Nugget_3A00_-Construct-a-timestamp-value.aspx
4--Once you will be done, then you need to go to Excel connection manger properites, there you need to go to expressiona and then have to select property--->FileExcelpath and then Expression-- @[User::ExcelFileName]
You might have to set Delay Validation property to true for this connection in propery pane.
5-go to variable property and set it to EvaluteExpression property to True.
The error which i am getting is
Error: 0xC0202009 at Data Flow Task, Excel Destination [20]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.
Error: 0xC02020E8 at Data Flow Task, Excel Destination [20]: Opening a rowset for "Excel_Destination" failed. Check that the object exists in the database.
Error: 0xC004706B at Data Flow Task, SSIS.Pipeline: "Excel Destination" failed validation and returned validation status "VS_ISBROKEN"
Can any one please help me out ?
Thank you