ssis

Delete or change records in ETL

天大地大妈咪最大 提交于 2021-01-28 19:07:48
问题 I have a table over which I have built an ETL service. Goods records (arrival / departure) go to the table. I have done that my table will be erased. When the item identifier arrives in the database for the second time, both records are deleted. label cost time x2 29 14/5/2020 01:00:00 x3 20 14/5/2020 01:02:00 x2 29 15/5/2020 03:12:02 Now ETL service remove records (every 30s): label cost time x3 20 14/5/2020 01:02:00 I delete it using the function: with todelete as ( select *, count(*) over

Establishing the connection from Script Task(VB) to OLEDB Connection Manager of SSIS Package

一曲冷凌霜 提交于 2021-01-28 14:18:47
问题 How to use the existing OLEDB connection Manager from scripttask Task(VB). i need to execute a SQL statement from "Script Task" Task. Edit Attempted the following code but couldn't get the connection with my OLEDB Connectionmanager Dim MyCM As ConnectionManager = Dts.Connections("MyConnection1") Dim CS As String = Dts.Connections(MyCM).ConnectionString sqlConn = New SqlConnection(CS) 回答1: I would refer you to this most excellent blog post by Todd McDermid, Using Connections Properly in an

SSIS and sending query with date to Oracle

跟風遠走 提交于 2021-01-28 06:26:59
问题 I am trying to create a flow to pull data from an Oracle table into a SQL Server table. I am sending the following query to Oracle to get the data: select distinct CHLD.id, nvl(chld_c_spl, 'N'), to_char(chld_d_start, 'YYYY-MM-DD') chld_d_start, to_char(chld_d_end, 'YYYY-MM-DD') chld_d_end from child chld, picture ptct where CHLD.id = PTCT.chld_id and nvl(chld_d_end, sysdate) >= to_date('01-JAN-2014') and chld_c_veri in ('HC','DR') and nvl(ptct_term, ptct_end) >= to_date('01-JAN-2014') When I

Get SSIS package name with C#

一笑奈何 提交于 2021-01-28 05:44:21
问题 I'm copying SSIS packages from one SQL server to another in a C# program via DTUTIL. The packages are in MSDB. string dtutilCmd = "/c DTUTIL /SOURCESERVER " + sourceServer + " /SQL " + myPackage + " /DestServer " + destServer + " /COPY " + myPackage; System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo

SSIS conditional split, but want to check a pattern

纵然是瞬间 提交于 2021-01-28 02:56:10
问题 Please see the below flowchart. How can i really achieve it. It tried various things in the SSIS Expression. 回答1: If you want to use regular expressions then you could use a Script Component to fill a (new) column and then use a Conditional Split to filter on that column. Or you could redirect the 'good' and 'bad' rows to their own output within the Script Component itself. Here is an example of that. It redirects bad email addresses to an other output: http://microsoft-ssis.blogspot.com/2011

How to EXEC a stored procedure from SSIS to get its output to text file

北城以北 提交于 2021-01-28 00:41:01
问题 I wrote a stored procedure that reads records into a temp table and then creates a pivoted output from the data in the temp table. Running the stored procedure from SSMS works just fine. What I am facing problems is now that I am trying to create the SSIS package that will execute the sproc, and write its output to a tab delimited text file. I am using Visual Studio 2015. My first problem is that when I try to configure the OLE DB Source within the Data Flow Task, when adding the SQL Command

Applying SSIS Package Configuration to multiple packages

这一生的挚爱 提交于 2021-01-27 23:57:50
问题 I have about 85 SSIS packages that are using the same connection manager. I understand that each package has its own connection manager. I am trying to decide what would be the best configurations approach to simply set the connectionstring of the connection manager based on the server the packages are residing on. I have visited all kinds of suggestions online, but cannot find anywhere the practice where I can simply copy the configuration from one package to the rest of the packages. There

How to convert string in format dd.mm.yyyy to date using SSIS expression?

谁说胖子不能爱 提交于 2021-01-27 20:56:16
问题 I have a date 26.12.2019 (dd.mm.yyyy) in CSV which I'm trying to convert to 2019-12-26 using Derived Column in SSIS. I have used this expression but it does not seem to work. (TRIM([Period Start Date]) == "") ? NULL(DT_DATE) : (DT_DATE)(SUBSTRING([Period Start Date],7,4) + "-" + SUBSTRING([Period Start Date],4,2) + "-" + SUBSTRING([Period Start Date],1,2)) How do I rewrite this expression to produce the correct output with a value of data type? 回答1: When using DT_DATE data type, value is not

Unable to retrieve stderror and stdout when calling a Powershell script from SSIS

旧街凉风 提交于 2021-01-27 20:31:54
问题 I have an SSIS package that calls some powershell scripts to consume web services. The problem is that when I write to stderror or stdout, the StandardErrorVariable and StandardOutputVariable are not picking up anything that is written to them from the script. The scripts execute just fine, so it isn't a problem with calling the script it just seems as if the standard output streams are not coming back to SSIS. Here's how the Execute Process task is set up: I've tried various ways of writing

Convert DDMonYY and time to datetime column in SSIS package (Derived Column)

↘锁芯ラ 提交于 2021-01-27 11:55:24
问题 I have the following data: 12APR19 0644 and I want to combine/transform these in SSIS so they appear in my final destination as: 2019-04-12 06:44:00.00 I've tried using (DT_DBTIMESTAMP) [DateColumn] [TimeColumn] but this gives me a generic error. Anyone help please? 回答1: First transform your string to dd mmm yyyy hh:mm then use the type case dt_date: (DT_DATE)"12 APR 2019 06:44" returns: 4/12/2019 6:44:00 AM which you can further transform get the format you want. OTOH if your destination is