ssis

SSIS: import MAX(filename) from folder

谁都会走 提交于 2020-01-05 04:14:12
问题 I need to pick one .csv file from \\\Share\Folder\ with max filename for further import to SQL. File name is alphanumerical, e.g. ABC_DE_FGHIJKL_MNO_PQRST_U-1234567.csv , where numerical part will vary, but I need the only max one each time the package runs. Constraints: no write access on that SQL server, I use ##Temp table for import and this is the least desirable method for filename processing (no for each loops on this server). Ideally it will be function/expr-based variable (combined

SSIS: “Error: The result of the expression ”@[User::FileName]…cannot be written to the property"

回眸只為那壹抹淺笑 提交于 2020-01-04 15:28:44
问题 I have been trying for the last 10 hours to solve the following problem: I have a ForEach Loop container that is enumerating Excel file names in my Control Flow. Within the ForEach Loop container I have an Excel Source that imports data into Sql-Server. This connects to a Derived Column transformation using User::FileName as the expression that connects to a OLE DB Command that that maps to the User::FileName to a Report_Date (the Excel file names contain the report date) column in Sql-Server

Avoiding SSIS script task to convert utf-8 to unicode for AS400 data to SQL Server

蹲街弑〆低调 提交于 2020-01-04 14:31:13
问题 After many tries I have concluded that the optimal way to transfer with SSIS data from AS400 (non-unicode) to SQL Server is: Use native transfer utility to dump data to tsv (tab delimited) Convert files from utf-8 to unicode Use bulk insert to put them into SQL Server In #2 step I have found a ready made code that does this: string from = @"\\appsrv02\c$\bg_f0101.tsv"; string to = @"\\appsrv02\c$\bg_f0101.txt"; using (StreamReader reader = new StreamReader(from, Encoding.UTF8, false, 1000000)

Avoiding SSIS script task to convert utf-8 to unicode for AS400 data to SQL Server

大兔子大兔子 提交于 2020-01-04 14:31:12
问题 After many tries I have concluded that the optimal way to transfer with SSIS data from AS400 (non-unicode) to SQL Server is: Use native transfer utility to dump data to tsv (tab delimited) Convert files from utf-8 to unicode Use bulk insert to put them into SQL Server In #2 step I have found a ready made code that does this: string from = @"\\appsrv02\c$\bg_f0101.tsv"; string to = @"\\appsrv02\c$\bg_f0101.txt"; using (StreamReader reader = new StreamReader(from, Encoding.UTF8, false, 1000000)

SSIS expression previous date without DateAdd()

心不动则不痛 提交于 2020-01-04 14:18:15
问题 Currently developing a package that passes an expression from a previous date to a filename. The current code I have is the following as a string variable: (DT_WSTR,20)DATEPART("YYYY",Dateadd("DD",-1,dateadd("MM",datediff("MM", (DT_DATE) "1900-01-01",getdate())-2, (DT_DATE) "1900-01-01"))) + RIGHT("0"+(DT_WSTR,20)DATEPART("MM",Dateadd("DD",-1,dateadd("MM",datediff("MM", (DT_DATE) "1900-01-01",getdate())-5, (DT_DATE) "1900-01-01"))),2) + "01" This currently produces the output of: 20171101

SQL Server Integration Services (SSIS) - Catch User-Stopped Debugging

六月ゝ 毕业季﹏ 提交于 2020-01-04 10:49:24
问题 For a custom audit framework that I am implementing in a SQL Server SSIS solution, I need to log when debugging stops. As far as I can tell, there are 3 possible situations: 1. An error is occured that is fatal (i.e. it is not ignored or allowed to occur to then be handled separately). 2. Execution finishes succesfully. 3. Debugging stops due to a crash or user stopping (i.e. the STOP button, shift + f5). 1 and 2 I can handle with an event handler and task respectively. However, I can't seem

Foreach Loop Container gives an error after 5 iterations. SSIS

半城伤御伤魂 提交于 2020-01-04 10:19:42
问题 I created SSIS package that iterates through Excel spreadsheets and load data into SQL. Using ForEach Loop Container. For some reason after 5 iterations I got an error. I tried: Set MaximumErrorCount to 0 on Foreach Loop Container ValidateExternaMetadata set to Off on OLE DB Destination Why it iterates 5 times and after that gives me an error?? 回答1: Them main issue is Opening a rowset for "New_Val$A3:C10000" failed. Check that the object exists in the database it is not related to the

Oracle connections broken in SSIS after uninstalling 32bit version of oracle client

元气小坏坏 提交于 2020-01-04 10:05:09
问题 I get the following error message when I try to test my connections: Test connection failed because of an error in initializing provider. The 'OraOLEDB.Oracle.1' provider is not registered on the local machine I originally had 32 bit and 64 bit version of Oracle 12 client installed on my work machine. I uninstalled the 32bit version, because it was causing some conflicts with another application, but now after uninstalling I can no longer use my oracle connections in SSIS. I'm using Visual

Execute SQL script after SSIS build or check-in

感情迁移 提交于 2020-01-04 08:22:47
问题 I am trying to find a better way to test our SSIS application, which is used to load data from a file into SQL Server and validate the file data. I have created a SQL script which can be run to insert 'bad' data into the database tables, and ensure that our validations are performing correctly. The SQL script: - loads 'bad' data - executes the SSIS validations - ensures the errors in the data were detected - Outputs a PASS or FAIL - Deletes the TEST data if passed Is there anyway I can get

How Intersect and Except result in SSIS

て烟熏妆下的殇ゞ 提交于 2020-01-04 06:52:56
问题 Have Two result Set A and B, In SSIS Merge Join how get EXCEPT and INTERSECT of A result set. Bellow sql syntax return desired out put: ---Insersect select a.* from A a Inner join B b on a.Key=b.Key --Except select a.* from A a left join B b on a.Key=b.Key where b.Key is null How to get those query result from SSIS merge join 回答1: According to his Microsoft Artcile, "The Merge Join transformation provides an output that is generated by joining two sorted datasets using a FULL, LEFT, or INNER