ssis - I have to run each task manually - sql

I am just starting on SSIS and created a simple package to start off with. I ran the import/export wizard from SSDT where I am copying table contents from a table to an excel spreadsheet. I eventually get the table contents on the spreadsheet but I have to run the Execute SQL task first, then run the Data Flow task second manually. Not sure why the data Flow task does not pick up after the Execute SQL task completes. The connection is set to run on success. I googled the heck out of this and cannot find an answer. I am running Visual Studio 2013 Shell (Integrated) version 12.0.21005. Any answer (or clue) would be greatly appreciated! Thank you!

Related

Cannot open a Script Task, but only one specific SSIS package, any suggestions please?

For only one particular SSIS package (v. 2005) I am getting the following error when trying to open the script task...
TITLE: Microsoft Visual Studio
Cannot show the editor for this task.
ADDITIONAL INFORMATION:
The operation could not be completed. (Microsoft.VisualBasic.Vsa.DT)
BUTTONS:
OK
I need to get into this to be able to edit it, also I am in the process of upgrading it to 2014. Once upgraded I can get in, but there is no code, so assume the upgrade is not working as it=self cannot see the code within.
I have tried other machines - same problem.
I have tried other packages - they work fine - even in the same solution.
I have tried a few resets found on the net/re-installs - same problem.
Clearly its something to do with this specific package only, but I am stumped.
I would expect to be able to open the Script task like any other, and be able to edit it. I would also expect the upgrade to work and contain the code.
If you want to read the Script Task code, open the package file (.dtsx) using a text editor (Notepad++), and search for the Script Task code, copy the Script Task code and recreate the script and paste the code within the Script editor.
If you have a problem with Script Tasks in visual studio 2005, then copy the code to an external file, upgrade the package to 2014 then paste the code inside the Script Task (since it will be empty after upgrade)

Visual Studio Writes Partial Data to Excel File

I have a visual studio package that does not write all the data needed to a blank excel file.
More specifically, the package goes through these steps:
Copies a template excel file to overwrite a shell file.
Connects to a SQL DB.
Runs a Select Statement.
Converts one column to unicode.
Pastes to shell file.
There are a few more steps afterward (like emailing the excel file) but those work fine.
The issue comes up for step 4. when Visual Studio or SSIS runs the package, I pull about 1400 rows. When I just run the select statement in SQL Server Management Studio or as a connection in Excel I pull about 2800 rows. 2800 is the right number.
I've tried building the process from scratch (excel files, connection files, etc.) but that rebuild elicits the same result. It's like Visual Studio just doesn't like the select statement. Double checked the mappings - all good. The data is pasting and being delivered fine, just not enough. No errors on visual studio either - it gives me that lovely (albeit confusing) check mark.
This was running as an automated package for about a year before this happened and I have no explanation. Seriously a headscratcher.
The only other clue I have is that when I pull the data manually with the select statement, there are no null values in a particular column, but when I run the package with that exact same select statement the output contains a null in the referenced column - almost as if the select statement in Visual Studio is pulling slightly different data than the manual pull, but the statements are exactly the same, so I don't know why that would be.
Any ideas?
I've seen this issue before. The timeout was set to an low value on the connection and caused it to only pull part of data before the timeout hit and killed the connection. Make sure you are not swallowing any exceptions and double check your timeouts.
Thanks for replying folks!
In the end, I solved the issue by completely remaking the package. While trying your solutions above, I was using the same file but building the connections and queries from scratch. Once I started from a new file it ran without error.
I guess to all those new folks to Visual Studio - always consider remaking the file from nothing!

Automate export from MS Excel to MS SQL Server

Is there a way to export data from a MS Excel file into a SQL Server table automatically? Maybe this is done using a script of some kind.
If it's not possible to be completely automated, perhaps there's a way to do it using minimal user effort. (For example clicking a button or link)
There is a MS Excel spreadsheet where the data keeps having to be manually exported to SQL Server.
I've done this using Excel to Access before, but not too certain on how to do it using SQL Server (MS).
*MS Office 2013 and MS SQL Server 2012.
The other answers are ok. I just want to suggest an additional alternative.
If it is just 1 specific Excel file that is frequently updated, I would consider using VBA. For example, write some VBA code in Excel that uploads changes to the database when the spreadsheet is saved (or the user presses a button).
The problem with using a scheduled job is that Excel is basically a single user application. If someone has the spreadsheet open or is doing something in it when the scheduled job runs or moves the spreadsheet to a different folder, then the job may fail.
This way you also get the updated data in your database in something close to real time instead of waiting on a job to run. This might take more time and effort to set up though than some of the other answers.
You can use SQL Server Agent to run a scheduled job that imports data from an Excel worksheet into a SQL Server table.
The import is relatively straightforward to do using Integration Services, but if you've not used either of these before you might need to do some reading up on it.
You can do the following:
You need to create an SSIS package and then create a job to run the package.
The easiest way to create the SSIS package is with "Import and Export Data" tool of SQL Server. It has a nice step by step wizard.
You set everything it asks you from the source and the destinations. Until you get here, select the "Save SSIS Package":
Then you only have to create the job to run it :)

Updating System variables in SSIS package

Similar to this post
I have an SSIS Package with a Script Task that creates an Excel file on disk and populates it with data from a SQL Stored Procedure (using Microsoft.Office.Interop.Excel). This works great when testing and when running the deployed package manually through the SSIS Catalog, but when I schedule the task to run automatically through SQL Server Agent, the Package fails in the Script Task step. I have the Job running as a Proxy account that is the same as the account I'm logged into the server with when testing (and the same as the account that works when manually running the packages).
My understanding is that even though the job is running using a Proxy, any desktop interaction occurs within the Profile context of the SQL Server Agent login. Since that profile isn't actively logged in, the interaction fails. Digging in more, there is a bool System Variable in the package called "InteractiveMode" that is set to "False". I have a feeling that if I could switch that to True, everything would be hunky dorey. Trouble is, that variable is only accessible to my Script Task as "ReadOnly"...
Is there any way to set the System:InteractiveMode Variable in an SSIS package manually or programatically at runtime? Please help! I'm having to run these scheduled jobs manually for now, which is a big pain.
Thanks.
I had this problem a few months ago and it turned out that the execution options needed to be set to use 32 bit runtime. If you're using SQL Server 2008 R2, you can open your job and double click on the step. It's under the Execution Options tab.
If you continue to have errors, you may want to consider changing the package so that it uses a file system task to create/rename the excel document and then a Data Flow Task to move the data from your stored procedure to your excel document. Depending on your data, you may need to add a Data Conversion step in between. Here's a good article on the topic: http://www.mssqltips.com/sqlservertip/3046/sql-server-integration-services-data-type-conversion-testing/
Edit:
I haven't used SQL Server 2012 yet, but according to MSDN, it looks like the option is under the Configuration tab. Here's their article: http://msdn.microsoft.com/en-us/library/gg471507(v=sql.110).aspx

can a sql 2005 ssis package be scheduled?

I have a data dump that I manually initiate and I want to automate things now that they are working well. I have a system that exports data into Excel that I ultimately want to import into a SQL table.
I have a ssis package that I used for the import and saved it for re-use later. I just manually ran it and it works well. Now I would like to have it run either when invoked by a file watcher or schedule or some thing so that all I need to do is over-write the excel file and have it trigger the ssis to run its import.
Any ideas on how to make this happen?
SQL Server does its scheduling with SQL Agent, so try creating a schedule in that to do what you want.