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

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?


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

SSIS Package can't find file under a directory in SQLAgent

$
0
0

I've created a SSIS package that will scan the files under a directory for data upload. The deployed package run well if directly execute it under Integration Services Catalog\SSISDB. But when schedule a job to run the package in SQLAgent, the system indicate there is no file found in the directory. Please help.

OnWarning

1/27/2016 4:52:16 PM

Scan Source Files: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.

Scan Source Files

 

\H_CP_Loader\Scan Source Files


Transaction

$
0
0

Hi,
The package has:
1- starts with an execute sql task which does the following:
delete from tblMain where IsNew = 1

2- DataFlowTask which places data from a source into tblMain

3- Execute sql task which audits the success

4- another execute task which audits the failure in-case of a failure

Question:
if step 2 fails, then obviously the execute task for the failure (Step 4) records the failure in a table which is what I want. Then what is the best way to rollback step 1 ?

Thanks

Unzip files from FTP location

$
0
0

Hi,

I have number of files in H:\ZIP\00985.zip,H:\ZIP\00986.zip etc and zip files contain .csv files.

What i want to achieve here ti unzip all the files and store it in H:\UNZIP\ 

I tried using execute process task


The task is executing but files are not getting copied.

Any help would be beneficial.

Thanks in advance.

Kaish


Lava


SQL Command, SPROC, Temp Table and Parameters

$
0
0

Hi

Objects: 

  • SPROC: [_ExternalPostPaymentsRec] , this generates a result set and loads to a temp table 
  • SSIS: OLE DB Source Editior and SQL Command with Parameters 

Trying to do 

I want to pass two Variables values are runtime and filter the Sprocs result set based on these parameters , I can easily do it using a table but I am struggling how to do this using a temp table , using OpenRowset and another temp table is what I have come up with so far , but understandable it does not recognize the temp table as it is created at runtime

CODE

SPROC: [Ibis_Dev].[Payments].[_ExternalPostPaymentsRec]

<<code here to insert to temp table >> 

SELECT *
FROM #Rec
ORDER BY CustomerId,Currency,rectypeid, Transactionid

 OLE DB Source Editior and SQL Command

SELECT * INTO #MyTempTable FROM OPENROWSET('SQLNCLI', 'Server=invdubmsqldev1;Trusted_Connection=yes;',
     'EXEC [Ibis_Dev].[Payments].[_ExternalPostPaymentsRec]
with result sets

 (  
   Transactionid INT,
 Currency CHAR(3),
 CustomerId INT,
      CustomerName NVARCHAR(50),
 Paymentdate DATE,
 Amount DECIMAL(25,2),
 rectypeId INT,
 PaymentDesc NVARCHAR(25)
 )
);')


SELECT  [Transactionid]
      ,[Currency]
      ,[CustomerId]
      ,[CustomerName]
      ,[Paymentdate]
      ,[Amount]
      ,[rectypeId]
      ,[PaymentDesc] FROM #MyTempTable
where 
[Currency] = ? AND
CustomerId=?


Error 

Invalid Object name #MyTempTable

Oracle Password not working after 24hrs

$
0
0

As the title says, my password for any Oracle connection seems to 'expire' after 24hrs. This is using either the OLE DB provider from Oracle, or the Attunity provider.

For both providers, I can change the password in Oracle SQL Developer and then setup a provider in my SSIS project. Test the connection successfully, Execute a few tasks, add some additional tasks etc and its all good.

Lock my computer, come back the next morning and.... Invalid Username/Password. Delete the Connection and create a new one with the same TNS, same result.

Opening Oracle SQL Developer I can still access the DB with my old credentials, including creating a brand new connection off the same TNS. Unfortunately, the only way to get in via SSIS is to change my password and update my connection manager\config\variable\whatever in the SSIS package. Checking and changing 32/64bit runtimes, restarting Visual Studio, restarting the dev machine etc does nothing.

So.... help? What the hell can this be?


The Coggs Machine

Can a Dynamic DataFlow be created in SSIS?

$
0
0

I am trying to create a SSIS package that will read file names from a table then import the data from a corresponding Flat file into a table with the same name.  The problem is that there can be hundreds of Flat files to be imported and each import requires a DataFlow.  Creating each DataFlow in Visual Studio would be very time consuming.

Is there a way to create DataFlows dynamically in Visual Studio?

Thanks in advance.


Mysearay


Share SSIS_Configurations table

$
0
0
We are using SQL Server configuration  and we have SSIS_CONFIGRATIONS table on SQL server.  We create connection string variable and pass it to connection in SSIS package. We have one database and we would like to create only one record per DB connection string and have all developer use that instead of each one creating separate configuration records. Issue is we have multiple developers and they are creating  different ConfigurationFilter  having same connection string.  They fail to use the same because PackagePath does not match due to different names for connection in connection manager. Is there alternative to this ? We can enforce rules for developer for naming connection but i want to know if there is a better more simplified way.

Column "A" cannot convert between unicode and non-unicode string data types

$
0
0

Column "A" cannot convert between unicode and non-unicode string data types

i have added the conversion block and changed the output columns. and changed the validateExternalMetadata setting. and still have the problem with converting from unicode to non-unicode. this package was working well in vs version 9 and after the migration to vs 2013 having these errors. any idea?

Execute Package Task in 32 bit mode

$
0
0

I have two servers, SA and SB, and two packages, PA and PB.

PA runs on SA in 32 bit mode.

PB runs on SB and needs to run in 32 bit mode.

When an "Execute Package Task" in PA executes PB, PB is executed in 64 bit mode.

PA and PB are both stored in SQL Server. Both SQL Servers are 2012.

Is there some means of executing PB in 32 bit mode from PA. I want to execute it in such a way that PA waits for the results from PB.

SSIS package to remove duplicate rows from flat file

$
0
0

Hi,

We are using sql server 2012. We get flat file which has duplicate rows. All the data between rows is same except 1 column. For this column, 1 row has empty value and another row has value as US. I need to keep the row with US value and delete another row.

What ever I searched so for shows the elimination of duplicate rows but data flow happens and goes into table or some other destination. I need duplicate rows removal happening in the file and keep the same file. How can I do with SSIS package. Is there any other alternate way of removing duplicates from file.

Thanks,

Spunny

ForEach Loop Container Not Getting All Files

$
0
0

Hello, August Members of the Sages Guild!

I have an SSIS package that processes incoming Excel reports into a historical SQL table for data mining. It's been working fine and dandy, but, recently, two runs missed some Excel reports.

It's not something I can replicate, as it's sporadic - highly so; the vast majority of the time, it works seamlessly - but, I've got a hunch that it's a matter of timing; that one Control Flow or Data Flow task is being flagged as complete when the actual process within that task is truly not finished.

What the package does;

Within a ForEach Loop Container;
1. Clear out Staging table 1 with a SQL Task doing a TRUNCATE,
2. Clear out Staging table 2 with a SQL Task doing a TRUNCATE,
3. Run a C# script to scan the existing Excel reports to find the oldest report and make it the active report,
4. Import Sheet 1 of the active report into Staging1,
5. Import Sheet 2 of the active report into Staging2,
6. Use a UNION ALL task to send both Staging1 and Staging2 to the History table,
7. Delete the active Excel report file.

Of course, the ForEach Loop Container will check for another report, processing it the same way, finally to stop when all files have been processed.

Now, this has worked like a charm for almost a year, but twice now - last week and today - the container signalled that it successfully completed - it turned green - before having run through all of the Excel files. The only real change is that last week the Excel files jumped in size to about double or triple what they had been when it worked flawlessly.

So, I'm thinking, maybe there is a task getting ahead of itself or something. I thought, maybe a task to run a 1 or 2 second timer to give SSIS a chance to ensure it can "catch its breath" before continuing on to the next task might alleviate this issue. Maybe, I thought, my Excel files are getting too big for SSIS to handle so much at one time. Maybe even, if there is such a setting, something to tell SSIS to slow down a mite.

I guess I could gin up a script to just run a loop to account for a couple of seconds delay, since there doesn't seem to be a timer task in the tooolbox, but I wonder if my hunch is even correct, before I embark on this adventure.

Any ideas?

SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft Office Access Database Engine" Hresult: 0x80004005 Description: "Unspecified error".

$
0
0

We are getting Below Error:

SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft Office Access Database Engine"  Hresult: 0x80004005  Description: "Unspecified error".
End Error

Our Environment:

OS: Windows Server 2008 R2 Enterprise ==> Service Pack 1

Intel(R) Xeon(R) CPU

64-BIT OPERATING SYSTEM

Database:SQL Server 2008 R2

Below article says that we need to give permissions to "C:\Windows\ServiceProfiles" read and write access to proxy account and our proxy account is a windows domain account. Is this really required?

http://sqlserverscribbles.com/2013/05/07/ssis-package-fails-when-executed-as-job-using-proxy-account/

https://support.microsoft.com/en-us/kb/933835

https://social.msdn.microsoft.com/Forums/en-US/474fb7f4-f911-4bf6-a171-8622c2479966/office-driver-on-cluster-windows-2008-sql-2008-server

Error Message we see in SSIS Scheduled SQL Job is given below

Message
Microsoft (R) SQL Server Execute Package Utility
Version 10.50.6000.34 for 32-bit
Copyright (C) Microsoft Corporation 2010. All rights reserved.

Started:  10:45:02 AM
Error: 2016-01-28 10:45:04.62
   Code: 0xC0202009
   Source: Package Connection manager "Excel Connection Manager"
   Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available.  Source: "Microsoft Office Access Database Engine"  Hresult: 0x80004005  Description:"Unspecified error".
End Error
Error: 2016-01-28 10:45:04.62
   Code: 0xC020801C
   Source: DFT Check For Empty File or No data Excel Source [1]
   Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
End Error
Error: 2016-01-28 10:45:04.62
   Code: 0xC0047017
   Source: DFT Check For Empty File or No data SSIS.Pipeline
   Description: component "Excel Source" (1) failed validation and returned error code 0xC020801C.
End Error
Error: 2016-01-28 10:45:04.62
   Code: 0xC004700C
   Source: DFT Check For Empty File or No data SSIS.Pipeline
   Description: One or more component failed validation.
End Error
Error: 2016-01-28 10:45:04.63
   Code: 0xC0024107
   Source: DFT Check For Empty File or No data
   Description: There were errors during task validation.
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started:  10:45:02 AM
Finished: 10:45:05 AM
Elapsed:  3.032 seconds

Check For Worksheet in Excel Workbook

$
0
0

Greetings, all!

There has been an update to our data for processing through SSIS in the form of a new worksheet added to the Excel files that we process.

I have an archive of all received Excel files that I keep on hand for the rare - but not unheard of - times when I am forced to rebuild the database from scratch. So, that means I have 225 Excel files stored away.

These files have two worksheets in them containing data to be processed named Tom and Dick. Now, we've had a third sheet added named Harry.

Rather than go through all 225 files to add a blank Harry sheet to them for those times when the database needs rebuilt, I'm wondering if there is a way to get SSIS to test the file for a Harry sheet and, if not found, just skip the processing section for that sheet.

I'm quite sure there's a way, but I am learning SSIS on my own and this is outside my experience.

Thanx in advance!


Exel to SQL DFTask loads some Null records

$
0
0
I have an SSIS package to import Excel data into SQL. When I look at Excel I dont see ANY Null rows. However when I run the SSIS package and check SQL, It loads some NULL RECORDS IN SQL. WHy is that It loads Null records in SQL, When i cannot see the Null recs In Excel?

SSIS 2012 - Job fails when using Proxy/Credentials to execute a package using UNC file path

$
0
0

Hi,

I created a SSIS package which generate a flat file on UNC filepath like:

\\ServerName\Folder\

 The package run fine when I am executing it through Data Tools but it fails when executing using Proxy job agent:

Description: Cannot open the datafile...

 I have configured a credential to use proxy to run SQL Job as its explained in many posts, but it still failing when executing job.

Regards,

Dynamic variablename

$
0
0

Hello All, I have a problem and I need some help solving this.

So far my program is doing the following:

- Script Task, creates an array with column names and stores these in and variable (System.Object) 

        Dim arr As New System.Collections.ArrayList()
        arr.Add("Col1")
        arr.Add("Col2")
        Dts.Variables("User::ColumnArray").Value = arr

- ForEach loop, loops through the array and stores the current column name in an variable (User::CurrentColumn)

- Script Task, creates an SQL which I store in an variable (User::SqlStmt)

-Data flow task, contains an OLE_DB Source which runs the sql from the variable User::SqlStmt

From here I would like to store the value from the OLE_DB (single value) in the variable which correspond to the value of the User::CurrentColumn variable.  Let's say that the value of User::CurrentColumn is "Col1" then I would like to store the value from the OLE_DB Source into User::Col1.

I will then use all columnvariables in another query.

Also, all the columns defined in User::ColumnArray are created as variables outside the script.

Best regards Mats

    

Need help for below error

$
0
0


[Execute SQL Task] Error: Executing the query "
" failed with the following error: "An internal DMS error occurred that caused this operation to fail. Details: Exception: Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.DmsSqlNativeException, Message: SqlNativeBufferReader.Run, error in OdbcExecuteQuery: SqlState: 42000, NativeError: 156, 'Error calling: SQLExecDirect(this->GetHstmt(), (SQLWCHAR *)statementText, SQL_NTS), SQL return code: -1 | SQL Error Info: SrvrMsgState: 1, SrvrSeverity: 15,  Error <1>: ErrorMsg: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near the keyword 'DEFAULT'. | Error calling: pReadConn->ExecuteQuery(statementText, bufferFormat) | state: FFFF, number: 156862, active connections: 1', Connection String: Driver={pdwodbc};APP=RCSmall-DmsNativeReader:AUPDW1-CMP02\sqldwdms (4160)-ODBC-PoolId1501;Trusted_Connection=yes;AutoTranslate=no;Server=\\.\pipe\sql\query". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

I trying hard to fix the issue but not sure what is the issue.

two Excel file all column comparison

$
0
0

Please suggest best method two compare two excel sheet[both are different file] and store the results in new excel sheet. The solution should give good performance.

I don't think Using Merge join comparing all columns is good solution. It may create performance problem.

Even the solution can be some C# / VB scripting. Even if we have with any command line also it is good.

Please suggest.

Viewing all 24688 articles
Browse latest View live


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