Quantcast
Channel: SQL Server Integration Services forum
Viewing all 24688 articles
Browse latest View live

Error: Variable "User::list_of_files" does not contain a valid data object -- Foreach Loop Container

$
0
0

I am working on a package using MS Visual Studio 2005 with SQL 2005.  The project is to first get a list of files in a directory on a server housed in a different department.  Then get a list of all the files that have already ran(this is in a file_load table located on our server).  These 2 lists are compared and files that equal are removed from the first list.

The final resulting list is to be used to copy the files from the outside server to our server.

The final step is where I am getting the error.  Right when it goes into the Foreach Loop, it errors out with Error: Variable "User::list_of_files" does not contain a valid data object,

 

 


FTP Task inside For Loop Container

$
0
0

I have an FTP Task inside a For Loop Container. The FTP Task is to retrieve a file from the remote server. The intent is to continually execute the FTP Task until the file is found. The setup looks like this.

The For Loop has a boolean variable that is initialized at FALSE and will only be set to TRUE by the Script Task when the FTP Task is successful. Until the file is found at the remote site, the FTP Task will fail and it will try again after 5 seconds.

But the trouble I have right now is that the For Loop will fail when the FTP Task fails and it won't go into a loop. I believe the key is in setting the Error Handler on the FTP Task so that the For Loop won't see the error and go into a loop.

But not sure if I am setting this up right. Can someone guide me through this?

ideas for file import and process

$
0
0

Hi,

I have a process that will import a txt file each month. There will be 2 separate txt files. One is a monthly file that will be delivered to a share between the 7th - 10th day of each month. There will also be a quarterly txt file that will be delivered on each month following each quarter end month (Q1 - delivered in April, Q2 - delivered in July, Q3 - delivered in October and Q4 - delivered in January of new year). All of the quarterly files will be delivered around the 21st of each month listed above.

the Monthly file is named 'In-force for Sales and Client Services - monthname 2015.txt'
the Quarterly file is named 'In-force for Sales and Client Services - Quarter 2015.txt'

what i need to do is automate this process in SSIS. I need to have the package check for file existence and if it is monthly file, go down one path, if it is Quarterly file go down another path. The package should be able to know what monthly or Quarterly file is coming next based on date. Once the file is found, it should follow correct path based on type of file. Once completed, file should be removed and archived and package should be ready to process next file when it gets dropped.

I've imported files using SSIS, but never did anything with this type of flexibility. Usually the file is always named the same thing. This process is a little different because the file names will be different based on the month and/or quarter and I will need to know wether it is a monthly or quarterly file based on file name.

thanks
Scott

Is the book steering me wrong? (synchronous vs. asynchronous)

$
0
0

Hi All,

Chapter 14 of "Professional SQL Server 2008 Integration Services" seems to do a good job of explaining synchronous and asynchronous transformations, but in the section "Data Flow Design Practices," it lists "three main design practices to constantly have in mind when designing packages," practice #1 is to "Limit synchronicity."  Shortly thereafter, it describes using a data flow to replace two Execute T-SQL tasks (1 does an insert, the next an update) and states that by doing this, "you are making the logic asynchronous.  You can seriously reduce overall process times by taking this approach."

The rest of the chapter goes on to suggest the same (making asynchronous as an advantage over synchronous).  On another page: "by bringing more of the processing logic into the Data Flow, the natural result is fewer process-oriented steps that require completion before moving on.  In the previous chapter, you looked at the general streaming nature of the Data Flow.  This translates to reduced overall processing times."

Am I misunderstanding?  Isn't a series of synchronous transforms likely to provide faster execution than asynchronous transforms (which would cause more execution trees)?

Thanks,
Eric


Error: 0x80004005 on Microsoft SQL Native Client

$
0
0

The below error happens when trying to use the SSIS Transfer SQL Server Objects Task to transfer objects. Related to (Bug?? Transfer SQL Server Objects Task - error when copying Views )?

--------------------

Error: 0xC002F325 at Transfer Data (NEW) Pre, Transfer SQL Server Objects Task: Execution failed with the following error: "ERROR : errorCode=-1071636471 description=An OLE DB error has occurred. Error code: 0x80004005.

An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Unspecified error".

helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}".

Task failed: Transfer Data (NEW) Pre

Case statement in SSIS

$
0
0

I am using Derived Transformation  to write case statement. For example

Case when Code='A' then 'Yes'

when Code='B' then 'No'

else 'Dont Know' end 'Output'

I replicated this in SSIS as

[XrefCode]=="A"?"Yes":[XrefCode]=="B"?"No":"Dont Know"

How can i replicate the below code in SSIS?

Case when Code in ('A','X','V') then 'Yes'

when Code in ('B','H','Q') then 'No'

else 'Dont Know' end 'Output'

excel error output to oledb destination table

$
0
0
Hi,
My query is to do with the error output from an excel file.
The excel file contains several columns.
SSIS takes the excel source and places the data into a sql server table using oledb destination.
There is a date column which in th edestination is also Date datatype.
sometimes the Date column in excel file has the value unknown or NA.
I dragged the error line from excel source to the oledb destination table and set all the columns to redirect row in the popup.
But when I run the package, all the rows including the one which has incorrect data i.e the row which has the word unknown in the Date column.
I want this row to go to the error destination but it does not. do you know why please? thanks

For Loop using SSIS Variables

$
0
0

I am trying to use a FOR LOOP to continue monthly processing. The SQL Task populates variables successfully and the control table is being updated as designed. When the process finishes it fails because there is no continuing timeframes to process.  How do I configure this loop to not fail once my variables stop being populated by the stored proc?


KDW



SSIS license is it included in sql BI 2012 ?

$
0
0

dears

we bought SQL BI 2012 server license. does in include the license for SSIS or do i need to buy it separately?

regards

Need help: Importing Swift Messages MT103 and MT202 into MSSQL database table.

$
0
0

Hi all,

I have daily generated Swift MT103 and MT202 messages in text files with the following format:

file 00590031.txt

{1:X12XXXXXXXXXXXX1234567890}{4:{177:1234567890}{451:0}{108:12345678910112XX}}{1:X12XXXXXXXXXXXX1234567891}{2:X1234XXXXXXXXXXXX}{3:{108:12345678902033XX}}{4:
:20:12345678910111X
:32A:151102USD220000,
:53B:/12334
:57A:XXXXXX12XXX
:72:/XXX/XXX. XXXXXX X/X 12345678
-}{5:{MAC:00000000}{CHK:123456XXX1X2}}                                                                                                                                                                                                           

file 00590032.txt

{1:X12XXXXXXXXXXXX1234567890}{4:{177:1234567890}{451:0}{108:12345678910112XX}}{1:X12XXXXXXXXXXXX1234567890}{2:X123XXXXXX12XXXXX}{3:{108:12567891011121XX}}{4:
:20:12345678910111X
:21:XXXXXX1234XXXX1X
:32A:131122USD10000000,
:53B:12345678
:57A:XXXXXX12XXX
:58A:XXXXXX13XXX
XX1234XXX
-}{5:{MAC:00000000}{CHK:12X1X123XX12}}                                                                                                                                                                                                 
file 00590033.txt
{1:X12XXXXXXXXXXXX1234567890}{4:{177:1234567890}{123:0}}{1:X12XXXXXXXXXXXX1234567890}{2:X123XXXXXXXXXXXXX}{4:
:20:ABC/ACC/OPS 123
:23B:CRED
:32A:151207KWD100,000
:50A:ABCDEFGH
:53B:/1123456789
:57A:ABCDEFGH
:59:/XX12XXXX0000000000000000000000
XXXXXX XXXX XXXXXX XX-XXXXXXXX
XXXX X/X
:70:XXXX XXX : 123456
XXXXXXX X/X XXXX XXXXXXXXXX
XXXXXXXXXXX, XXXXXX.
:71A:OUR
-}{5:{MAC:00000000}{CHK:1X12X12X1234}}                                                                                               

Using SSIS, how can I loop through each file and import only the selected contents from the files?

For example file 00590032.txt I need:

"12345678910111X" from key reference 20 to be inserted into column name "Transaction Reference Number" in the database table.

"131122USD10000000," from  key reference 32A to be inserted into the following columns:

"131122" --> "Value Date" (yyMMdd), "USD" --> "Currency", "10000000," --> "Interbank Settled Amount" (in the amount the comma is the decimal point followed by 00)

"XXXXXX12XXX" from key reference 57A to be inserted into column name "Account With Institution 1".

"XXXXXX13XXX" from key reference 58A to be inserted into column name "Beneficiary Institution 1"

"XX1234XXX" from the line after reference 58A to be inserted into column name "Beneficiary Customer 1"

----

For the other text files, I will need to map the key references:

21 --> "Related Reference"

23B --> "Bank Operation Code"

53B --> "Sender's Correspondent"

57D --> "Account With Institution 1"

58D --> "Beneficiary Institution 2"

58D --> "Beneficiary Customer 2" on the second line

59 --> "Beneficiary Customer"

70 --> "Remittance Information"

71A --> "Details of Charges"

72 --> "Sender to Receiver Information"

I tried inserting the values from a single Swift text file but it fails when I switch to another swift text file with different key references.

How can I maintain the column mapping for all the text files with different key references.

I appreciate any help.

Thanks in advance.

SSIS Script Task and Database Mail

$
0
0

SQL 2014, VS 2013

I have a really strange issue that I have not been able to tack down.

I have written a SSIS package that reads a Remittance text file into CRM. once in CRM, I have a task that generates a pdf file from Reporting services and dumps them into a folder, one for each remittance. Once this task is completed, it generates an email to all the customers, attaches the remittance pdf  and sends it as email via database email

As I am testing, I have set every email to come to my own email address.

All Pdf files are between 3 & 9 KB

The problem I am struggling to understand is that some emails get sent but some don't. I have checked the size of the files for the emails not sent expecting them to be large, but they are not. The are the same size as some of the ones that were sent ok.Looking into the Database mail log , I can see the following ( not very helpful error )

Date  10/01/2016 20:37:58
Log  Database Mail (Database Mail Log)

Log ID  3552
Process ID  1676
Mail Item ID 1947
Last Modified 10/01/2016 20:37:58
Last Modified By sa

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2016-01-10T20:37:58). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
)

Can anyone point me in the right direction as to where the problem may lie

    Public Sub Main()
        '
        Dim objRSExec As New ReportServer.ReportExecutionService
        Dim objDocumentNumber As New ReportServer.ParameterValue


        Dim objParams(0) As ReportServer.ParameterValue

        Dim objResult() As Byte
        Dim objStream As FileStream
        Dim strFileType As String = "PDF"
        Dim strFileExtension As String = ".pdf"

        strFullPathName = Dts.Variables("User::WorkingDirectory").Value.ToString & "\Remittance Advice for Supplier " & Dts.Variables("SupplierRef").Value.ToString & " Document No " & Dts.Variables("User::DocumentNumber").Value.ToString & ".pdf"


        Try
            With objDocumentNumber
                .Name = "DocumentNumber"
                .Value = Dts.Variables("User::DocumentNumber").Value.ToString
            End With

            objParams(0) = objDocumentNumber
            'objParams(1) = objCurrentLicence

            With objRSExec
                .Credentials = System.Net.CredentialCache.DefaultCredentials
                .Url = "http://XXX.XXX.XXX/reportserver/reportexecution2005.asmx"
                .LoadReport("/XXX/SSISRemittance", Nothing)
                .SetExecutionParameters(objParams, "en-us")
                objResult = .Render(strFileType, Nothing, strFileExtension, Nothing, Nothing, Nothing, Nothing)
            End With

            objStream = File.Create(strFullPathName, objResult.Length)
            With objStream
                .Write(objResult, 0, objResult.Length)
                .Close()
            End With

            ' Check File Size
            Dim length1 As Long, length2 As Long
            Do
                length1 = strFullPathName.Length
                System.Threading.Thread.Sleep(1000)
                length2 = strFullPathName.Length
            Loop Until length1 = length2

            SendMail()

        Catch ex As Exception
            MessageBox.Show(ex.Message.ToString)
        End Try



        '
        Dts.TaskResult = ScriptResults.Success
    End Sub

    Public Sub SendMail()
        Dim SQL_Connection As New SqlConnection
        Dim SQL_Command As New SqlCommand
        Dim sp_response As Integer = 0

        ' Try and connect to server
        SQL_Connection.ConnectionString = "Data Source=XXXX.XXX.XXX;Initial Catalog=Remittances;Integrated Security=True"

        Try

            SQL_Connection.Open()

            SQL_Command.CommandText = "SENDREMIT"

            SQL_Command.Parameters.AddWithValue("@Addressee", Trim("pete@cashbacs.co.uk"))
            SQL_Command.Parameters.AddWithValue("@Title", Trim("Remittance Advice"))
            SQL_Command.Parameters.AddWithValue("@Message", "Test")
            SQL_Command.Parameters.AddWithValue("@filepath", Trim(strFullPathName))
            SQL_Command.CommandType = Data.CommandType.StoredProcedure
            SQL_Command.Connection = SQL_Connection
            sp_response = SQL_Command.ExecuteNonQuery

            'Return sp_response
            SQL_Command.Dispose()
        Catch ex As Exception
            Throw New Exception("SendEDDSAdvieces " & ex.Message)
        Finally
            SQL_Connection.Close()
            SQL_Connection.Dispose()
        End Try

    End Sub

 


Dont ask me .. i dont know

SSIS Package fails becasue of Destination Server Connectivity is failing freequently

$
0
0

I create a ssis package in my desktop. this desktop has connectivity to two different servers. in that package, I am loading data from one server to another server table using dataflow task(i created oledb connetion managers for databases of two different servers).

Problem is destination server connectivity is failing freequently(for every 20 minutes) and becasue of that my package is failing and pipeline issue is showing.(both are sql server databases).

how to resolve this issue.

is connect timeout option in destination connection manager is helpful for this,?

I set connect timeout option for 10 secs first time, after loading 1lakh records, it fails

second time I set connect timeout option for 300 secs, it loaded 3 lakh records and then fails

when fails, it is showing below errors

[OLE DB Destination [2]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "OLE DB Destination.Inputs[OLE DB Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "OLE DB Destination.Inputs[OLE DB Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "OLE DB Destination" (2) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (15). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.
[OLE DB Source [65]] Error: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on OLE DB Source returned error code 0xC02020C4.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.


what is meant for connect timeout and general timeout options in ssis


tsrkreddy

Automatically print report (SSRS) via SSIS

$
0
0

Hi all, I am sorry for my English, but I have problem.

I have SQL database for industrial technology. Reporting services with some reports.

Now, in one step in SQL procedure I need call SSIS package with parameters which automatically generate report and sent to printer.

I don't know how I should do it. Can anybody help me?

Thanks for your help.

table partition and parallel load in SSIS

$
0
0

1. load data for different batches in the same set of tables parallel using SSIS 2012

Steps :

a) Created 4 file Groups and 4 ndf  files .

b)1st ndf file points to C drive

c) 2nd ndf file point to D drive

d) The remaning 2 ndf is pointed to D drive

3. Create Partition Function for values 10,20,30  (RIGHT Partition On BatchId  ) which is available in the Target Table  as column 

4. Create Partition Scheme on the 4 File Groups

5. The Target Table has been created using Partition Function using BatchId

6. While Loading data parallel for 2 batches i.e 1 to 10 and 11 to 20 locks are coming.

Please suggest the best approach 

SSIS writes empty text file while doing update in same Data Flow task

$
0
0

I've seen questions similar to this but couldn't find one exactly like this one.  I have two control flows both are pretty similar and suffer from the same issue so I'll just reference one here.  The control flow just has one data task item.  In the data task I have 4 objects flowing like this:



My problem is that when this runs as a SQL Agent job, the text file that gets created is empty.  However, the job runs successfully. The update occurs as expected as well.  I originally had the update task in line with and in place of the multicast task but this would get me an empty file whether I ran the tasks in a job or manually.  using the MUlticast seems to allow me to run the tasks manually and get the correct results (File created, and update performed), however, when I updated to current configuration and it runs from a job, the text file is empty, but I can get the correct results if I run it manually.  Any idea what's causing this behavior or how I can properly update a table after the results have been printed to a text file?

Thanks

Dwayne


Using Insert Into Select, with Execute SQL Task throws "Invalid number of result bindings ... for ResultSetType_Rowset"

$
0
0

I'm using SSIS to insert data into a table using a select query.  The insert works fine in SSMS but I get the error:  There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_Rowset". when I attempt through SSIS.  I have the ResultSet set to Full  But I don't have any parameters or varialbes setup because it's just a straight query.

The table is setup as having :

TestTblA:

Col1, Col2, Col3

Insert INTO TestTBLA

Select 'INOOO' as Col1, Col2,col3

from tblB join Tblc on tblb.pkcol = tblc.pkcol

where tblb.date = getdate()

This is obviosly a stripped down version but I have reviewed that the number of fileds in the insert match the number of fields in the accompanying select statement.

Any assistance would be appreciated

Dwayne

 

Importing Excel into Sql Server Management Studio 2012 Truncated Error

$
0
0

I am attempting to import an excel sheet into Sql Server Management Studio 2012 using the Import Wizard. My excel sheet has fields that have more that 255 characters. I have built a table in sql and the Date Type for each column is varchar(MAX). When I attempt the import I get error 0xc020901c "Text was truncated or one or mare characters had no match in the target code page".  After which none of the data is imported into sql.  

Playing with the data if I reduce the number of characters in each field in the excel sheet below 255, I can import the data into Sql.  Is there a way I can import an excel sheet that has more than 255 characters in each field?

SQL Command from Variable option is giving me below error when using Sybase ASOLEDB Provider

$
0
0

Hi Everyone,

I am trying to build a dynamic query and using SQL COmmand from Variable option. My source is SYBASE Server and I have a dynamic Source Connection, the provider is ASOLEDB Driver. It works fine when its a Static Query.

This is how my advanced editor looks like

Changed the Always use default code page to False with out any luck, Any help would be much appreciated.

TITLE: Microsoft Visual Studio
------------------------------

Exception from HRESULT: 0xC020204A
Error at DFT_CreateLookupCacheRefTables [OLE_SRC_ValidInstrumentIDCadis [264]]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.

Error at DFT_CreateLookupCacheRefTables [OLE_SRC_ValidInstrumentIDCadis [264]]: Unable to retrieve column information from the data source. Make sure your target table in the database is available.

------------------------------
BUTTONS:

OK
------------------------------

Retrieve specific cell value from Excel into SSIS variable

$
0
0

Hi all,

I'm experiencing a very frustrating issue. I am using the guide below to read a cell value in Excel into a SSIS variable;

http://www.techbrothersit.com/2013/11/ssis-read-excel-cell-value-in-ssis.html

It works very well for anything but a cell that has a date in it! I have tried to change the data type of the SSIS variable to everything possible but it still doesn't work, and I keep getting this error message;

An error occured while assigning a value to variable "ValuationDate": "Unsupported data type on result set binding 0"

The cell I am trying to read is B4, and the SQL Statement I am using in the Execute SQL Task isSELECT * FROM [Sheet1$B4:B5]. I am happy this is correct because if I change the value in B4 to anything that isn't a date, it works.

Please help!!

Error in list of function arguments

$
0
0

Hi All,

I'm loading data from Oracle db into a flat file. I created a new connection in the connection manager and i chose the provider "Native OLE DB\Oracle Provider for OLE DB"

Data access mode is a SQL command ( i did run this using TOAD and SQL Developer w/o any issues). When i had the same sql in the source editor and parsed it successfully its not working and giving the following errors

Error in list of function arguments:'|' not recognized.

Error in list of function arguments:')' not recognized.

Error in list of function arguments:',' not recognized.

Unable to parse query text.

Can some one please point me in the right direction ? While researching some one said the sql should be compatible with the db against which the sql is running and it is . 

I think its come REPLACE functions that i'm using and also some special function to combine multiple rows into a single column

like 

rtrim(dbms_xmlgen.convert(xmlagg(xmlelement(e,
S.Activity || '; ')).extract('//text()').getClobVal(), 1),
', ') as Activity

Thank You

Viewing all 24688 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>