.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

if ssis package writes to excel file that might be open by a user

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
I have written a package that writes to an excel file to a network folder. Eventually this package will run as a job. What is the best way to handle the situation where someone opens the file or inadvertantly leaving it open while the package is running and and stop the package.? No one needs to modify or write anything to this file after it is finished

View Complete Post

More Related Resource Links

Create Excel file dynamically in SSIS package and fill it by resultset data returned by Stored proce


Hello Every One,

I have a scenario in which i am executing a Stored Procedure which returned a result set.

I want to create a Excel file [name_date_time] dynamically, and fill result set data into Excel file. And then finally sent Excel file to Specific user[Email ID].

Point is that the excel file should have unique name so i want to give name as name_date_time.

So every time when package run new file is created with unique name.


Can any one suggest me who to create Excel file and fill result set data into Excel file.

And then finally send that Excel file ?







Can not get excel connection when calling an SSIS package from ASP

I have an SSIS package importing data from excel. I have coded it and deployed it on the sql 2008 server. I then execute it via a stored procedure with the following: select @cmd = 'C:\"Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /sq "HRIS"' select   @cmd = @cmd + ' /SET \Package.Variables[User::path].Properties[Value];"' + @path + '"' exec   @rtn = master..xp_cmdshell @cmd   This works fine when  i execute it on my local machine. But when I try to call this Stored proc from my asp app (classic asp, not .net) I get the error: Code: 0xC0202009 Source: HRIS Connection manager "SourceConnectionExcel" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Unspecified error". End Error   Any help would be greatly apprecitated

Problems running a bat file within a SSIS package

I have a ssis package which has 2 tasks, first it builds an excel sheet with data on the server from where I am running the ssis pkg and the second task (a sql process task), runs a bat. the bat file that basically copies the  excel sheet created from the first step to another server. Problem is that the ssis pkg runs succesful when i run it from BIDS, bust when I run is as ajon, it gets hung. It completes the first step, it is the sescond step that is get hung. I noticed that when i run from BIDs, it does come up with a window open file - security warning and says the publisher could not be verified, are you sure you want to run this software. why does it do that ??? the file I am asking to run is a .bat file. it should automatically use the cmd.exe app to run the bat file. Please help !!!   Thanks in advance.

Loading Decimal Number From Excel into SQL Server 2005 using SSIS Package

If you have an excel spreadsheet that displays a number .02 (because it is formated) but internally it is stored as .2654329 and you want to load .2654329 how can you do that in the SSIS package?  When we load the spreadsheet it is loading .02.  Is there some kind of option in the SSIS package to tell the package to load the internal number?lcerni

ssis 2008 Loading MULTIPLE EXCEL file

HI it is possible for me to load multiple text file using for each loop,but if i try the same process for EXCEL file then my excel source throws an error. Also when i created my variable in value  i have given the path of my excel file ,still it didnt help me..because the moment i map the variable with the connection string of source excel connnection(property->expression->connection string) it start giving error if you could help me or provide some reference it will be of great help http://bi-polar23.blogspot.com/2007/08/loading-multiple-excel-files-with-ssis.html i tried this link but got stuck with it on step 12 and 14 (below  is my connection string) and variable is @Filename which i have created Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\mushtaq.sheikh\Desktop\ForEach\New Microsoft Excel Worksheet1.xlsx;Extended Properties="Excel 12.0;HDR=YES"; The moment i try to edit my connection string by comparing connection string provided in link it gives error(an OLEBD error has occured with error code 0x80040E73) on excel source Thanks in advance

SSIS package - change Web reference's addres from Configuration file?

Greetings. The SSIS packages provide very nice options to configure them from an XML file, which allows to change credentials, database names etc w/o editing the package. This lets me, say, transfer package from one server to another or from test to production w/o any hassle - just changing the xml. Problem is, i need to acces a web service in my package, and built-in SSIS web service task is useless and just SUCKS. It fails to work even with miscrosoft's own sharepoint web service. So, i have to use scripting task. And scripting task uses "web reference" to access web services, which in turn gives no way to change it's url.  So, if i want to test and then move to production, i'll have to edit my package to change the web reference url from "testserver:5123/mywebservice" to "productionserver:81/webservices/mywebservice". And then change it again to test it again. Etc. Is there a solution to this? A way to programmatically change web reference's url from inside scripting task?

SSIS 2008 - Excel Source using SQL Connection cancels as soon as package runs.

Let me preface this by saying I'm brand-new to SSIS development. I'm using 64-bit SSIS 2008 and I'm trying to read an Excel spreadsheet using OLE DB. I've already run into and corrected the Run64BitRuntime problem.  Now when I invoke the Package it cancels immediately with the following output: SSIS package "Lesson1X.dtsx" starting. Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning. SSIS package "Lesson1X.dtsx" finished: Canceled. The program '[5400] Lesson1X.dtsx: DTS' has exited with code 0 (0x0). When I edit the Excel Source component itself there are no errors and I am able to Preview the results successfully.  If I use Table or View to access the file, the package runs successfully. Any suggestions will be greatly appreciated. Thanks

Cannot open .XLSX file in Excel 2010 from WSS 3.0 site



I'm having trouble in opening .xlsx files created using excel 2007. File is on the sharepoint site (WSS 3.0). Since I have installled Office 2010 I am not being able to open this file directly from the browser. However, if I download it on my local PC its seems to open fine.

Excel 2010 shows error "Excel cannot open file "filename" because the file extension or file format is not correct. Verify the file is not corrupted..."

Please can someone suggest what I am missing on my sharepoint site?


SSIS 2K5 - Deploy SSIS Package with C# - Error File cannot be found



I made a installer program in C# that deploy ssis package on a SQL server 2005. I have like 50 package that contain only dataflow to update a datawarehouse and create fact tables.

I made also one package that call all the other packages. When I try to deploy the packages on the SQL server with the command SaveToDtsServer, I receive an error BUT only on the package calling all the other SSIS package ?? All the other SSIS packages are deployed but the package that call other packages failed to deploy. Whats strange is that when I use the domain controler to deploy the package (I use Impersonation in my C# code) its all working fine, but if I use another user (like the computer admin account), I got the error only on the package calling other packages ???

Can anyone help me on that ? I really don't know whats happening ?

The error that i have is : The file can't be found. But like I said, when using the domain controler user for impersonation, its working ???



    imp = new Impersonation(session["DBMASTER"], session["DBMASTER_PWD"]);


Unable to open an Excel File in Sharepoint MOSS 2007


I am unable to open an excel file in Sharepoint (MOSS 2007). All other documents work fine. As far as I know there was no change on the Server at all.

Excel found unreadable content in 'stuff.xls'. Do you want to recover the contents of this workgroup? If you trust the source of this workbook , click Yes

When I click YES >> It says "Excel recovered your formulas and cell values, but some data may have been lost." And then a link to an xml file , which reads :

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <summary>Errors were detected in file 'http://server_name/Project_name/Shared Documents/abc - def/Phase 5/Track/stuff.xls'</summary>
- <additionalInfo>
  <info>Excel recovered your formulas and cell values, but some data may have been lost.</info>

Now this has resulted in huge loss of data and I can see New numbers in the cells which is very strange!

Is there a way I can get it back ? I do not have a

SSIS: Error in the package when the data in the flat file source is modified


Hi All,

I have a package which loads data from a flat file source to an OLEDB destination, which is executed successfully and data is loaded perfectly.

But later when the data in the flat file source is modified i.e. if an extra column gets added to the text file, the package is throwing an error because it is unable to detect the extra added column.

How can i avoid this error??? I need my package to execute successfully ignoring the changes(added columns) happened in the flat file source.

Please provide me wth your suggestions and solutions....

Thanks in Advance!!

SSIS package not able to save encypted user sensitive password


i have an ftp fetch package in bus development studio 2008.  it runs from that interface.  i imported it into Integration Services, set the password along with the EncryptSensitiveWithPassword and if i manually enter password each time i can run successfully from sql integration services.  but i cannot schedule as a job because the password won't stick.

any help out there would be great.

When dynamically creating an excel file, can SSIS create xlsx files successfully? I can only get SSI


Problem: An Excel file (XLSX) dynamically created by a SQL Task cannot be opened via Excel. The task succeeds, but when you try to open the workbook in Excel you get the fillowing error message: Excel cannot open the file 'myfile.xlsx" because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

1. If the Excel file (xlsx) is created manually in Excel, then the SQL Task has no problem creating table (new worksheets) in the xlsx (so the "CREATE TABLE" statement works fine)
2. If I adjust the connection and task to work with Excel 97-2003 (xls) format then the approach works perfectly
3. The execution results show success of the SQL Task, but there are two warning messages. These same warnings appear when the SQL Task creates a new table (worksheet) successfully in a workbook (xlsx) which was created manually in Excel (and is not corrupt). Messages as follows:
Warning: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Warning: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

SSIS Details:
1. ConnectionString: "Data Sour

Cannot open SSIS 2005 package


HI, one of developers gets the folowing error when he tris to open a SSIS 2005 pacjage:

Could not load type 'Microsoft.SqlServer..Dts.Design.IDtsPipelineEnvironmentService' from assembly 'Microsoft.SqlServer.Dts.Design. Version=

Is there something I can do to resolve this issue?

Thank you,

Christian Cote

Failed to open package error from SSIS Install Wizard


I'm unable to install a package using the install wizard.  The packages are located in the same directory as the *.SSISDeploymentManifest.  I've been able to do this install on one Server machine, but it won't work on my other Server.  I'm unable to find any setup differences other than one is using SQL2005 32bit and the one that doesn't work is using SQL2005 64bit.

Below is the error I get...

TITLE: Package Installation Wizard

Could not save the package "C:\AlarmPro\Deployment\install 2.1 build3\PKG_LogicOneIntegration_STG.dtsx" to SQL Server "(local)".


Failed to open package file "C:\AlarmPro\Deployment\install 2.1 build3\PKG_LogicOneIntegration_STG.dtsx" due to error 0xC00CE558 "XML document must have a top level element.".  This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.


Import Excel file with Data Connection into SSIS


I have got an Excel spreadsheet with a Data Connection that I want to import into SSIS. The problem is that the Data Connection does not seem to run at the time the file is imported, so it only calls "old" data.

How can I set SSIS up to run the Data Connection first, or is there something I need to change in my Excel spreadsheet setup?

When a person opens the Excel file normally, they first need to "Enable" the Data Connection in the Security Settings. Once that is done the data will update immediately. I wonder if that is something I somehow need to change to make it work in SSIS?

SSIS package is not reading from the configuration file in job step configuration tab

Hi everyone,

I have the following question. I have an SSIS package and it has in SSIS in BIDS 'Enable package configuration' and a full path to a file. The packages works ok and reads from this file.

 If I invoke the same package from sql agent as a job step and apply another configuration file in the job step (in tab COnfigurations), the package still uses the one in BIDS. Shouldn't this new config file overwrite the one from BIDS or?

Thank you

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend