SSIS and configuration files - file

I have an SSIS package that uses a configuration file which only contains the InitalCatalog and ServerName for an SQL Server database connection. If the configuration file is missing, the SSIS package produces a warning that the file is missing but carries on executing.
If the database connection manager in the package is configured with a different Server Name (ServerName in the configuration file) and Database Name (InitialCatalog in the configuration file), the package will run and use the "wrong" database, i.e. the one in the package's connection manager, not the one in the configuration file.
I have got round this by writing a Script task that checks for the existence of the configuration file and executes the line Dts.Events.FireError(0, "Script task", "Missing Configuration File", String.Empty, 0); if the file is missing. This results in an error being returned to the package and it terminates.
Surely, an SSIS package should terminate if it can't find its configuration file?
Apart from my workaround above, is there any other way to force a package to error and exit if it can't find its configuration file?
Thanks,
Kevin

Related

Deployed SSIS package will not read a file

I have an SSIS package that is supposed to read a folder and if the folder contains any text files, it will read them and store the data into a database. The package works flawlessly from the file system, however when I deployed it it fails.
The package uses a project level variable that remains consistent that acts as a folder path to see which folder to look in for files.
The SQL Server Agent gives me this error:
After looking at the execution report I see following error messages if I execute it with the service account through SQL Server Agent:
"The file name property is not valid. The file name is a device or contains invalid characters"
"The file name '(path here)' specified in the connection was not valid"
"The Flat File Connection manager failed validation"
However, if I run it myself by directly right clicking on the package in the catalog and executing, the execution report will come back as successful but it will contain a warning that says: "Read Files From File Input Folder Warning: The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty"
I suspect it is a permissions error, but I haven't dealt much with the permissions in Microsoft SQL Server and the service account that I am using was not created by me. I have tried changing the security of both package and project from the default "Encrypt sensitive data with user key" to "Do not save sensitive data", rebuilding and redeploying but that didn't help at all.
It is most likely a permissions error but I've been puzzled on how to go about it. Any help is much appreciated!
EDIT: After setting the "Delay Validation" on tasks in the control flow and executing the package with SQL Server Agent it now comes back with 2 less errors
For filesystem task to work the executing account need permission to the folder in question. When you execute the package via the SQL-agent the package is executed under the account running the SQL-agent account, when you right click the package and press execute the package is executed as your account.
One problem could be that the SQL-agent account doesn't have permission to the folder, and can't enumerate the content. You can verify this by changing the SQL-server account to your own account temporary and running the job again:
Open Sql Server Configuraiton Manager
Under SQL Server Services double click SQL Server Aggent
Change the account to your own account
Restart the service
If this resolvs the problem, change back to the SQL-server account and check the folder permissions on the folder you are trying to enumerate. Add the SQL-agent account or group the account is included in to have permission to read the folder. Obviously you can also just check the folder permissions to begin with, and make sure the executing account have permission to it.

ssis [File System Task] Error: An error occurred with the following error message: "Access to the path is denied."

So, I have an SSIS package that checks for file existence on the server, copies data from the file onto a table on sql server and moves the file to a done folder.
I have created environment variables and since I have full access to folders and to the server..the package got executed successfully. But, When I selected QA environment in the configuration manager and when I run the package..it's failing to move the file to the done folder and the error in execution result is - [File System Task] Error: An error occurred with the following error message: "Access to the path is denied.".
I have used user variables within the File system task
and the package overview
My question here is - since the file is present in file explorer on QA box and I don't have access..is it the reason for it to fail. But, I am not using my credentials to login at the connection manager level. I am using SQL server authentication (got a service account created).
Please let me know if you have any questions.
Thank you!
My question here is - since the file is present in file explorer on QA box and I don't have access..is it the reason for it to fail.
This is the reason for the failure, yes.
When running a SSIS package in Visual Studio most things will run under your credentials. Yes, you need to specify credentials for some connection managers, but File System Tasks use the Local User's credentials. If you, personally, do not have access to a file, neither does an SSIS package you are running.

execute ssis package for another server, didn't see any files

I have SSIS package and on VISUAL STUDIO working good, for another server pre production also, but when i use production server and try loading xls files nothing do, didn't see any files. I hv the same permission both server sql so i Somebody can help me? I will be maximum enjoye if somebody will react!
Thank you very much for the suggestions!
My package imports xls files into a database on sql server
In the package I have a foreich loop cointainer and in the directory I use the variable " input folder path" .In the expression on my menager connection i have variable "Full Path" (with file name)
On preproduction server, the package is great and loads xls files. On production server no. And i have comunicat :"For each file enumerator, no files were found that matched the file pattern or the specified directory was empty."
I set delay validation (connection manager, task) is true, When i deploy on server my project again, the message "another user uses files" Nobody use this folder. only me.
I Use the mapped path // ​​fileserv / clientspath.filename.
I do not know what else i can write about this will be help self ..

SSIS Script Task check if file exists: fails from SQL Job

My SSIS Script Task works fine when is executed in debug mode, but when I execute package from a SQL Job, it doesn't: it doesn't find the file, even if the file exists.
The package and the file to found are on the same server; the SQL DB is on another one. I use the UNC path for finding file and I gave the right permission to the users defined on the file folder.

SSIS Package FTP Task Error: Directory is not specified in the file connection manager "User::ProcessingFileLocation"

I have one SSIS package that has FTP task which takes files from FTP and save on my local drive but i'm getting this error:
[FTP Task] Error: Directory is not specified in the file connection manager "User::ProcessingFileLocation"
In FTP Editor setting :
User::ProcessingFileLocation used SSIS variable
Values sets to this is \\MYSERVER\\Raw Data\\
Why getting this error any solution
When i mention direct path it is working fine but having error with variable :(
Another solution to this problem might be the one that affected me.
The FTP task does not create the path specified in the LocalVariable, make sure to manually create the destination folders.
override the UNC path with local path in Integration Services Catalog, connection manager. Right click on the project and choose configure

Resources