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

Create table in all databases

$
0
0

I'm trying to create a table and insert some data in all the databases through  package. Below are the steps .

1. Created variable user::database and set type as Object.

2. Created Exec sql task with query 'select database_id,name from sys.databases' and set resultset to variable user :::database.

3. Added For each loop container with ADO enumerator and set ADO object source variable to user::database. Added a new variable DBName with datatype=int32, added in Foreach loop container in variable mapping with index=0.

4. Added another exec sql task under for each loopcontainer with below script .

Under parameter mapping mapped User::dbname with Direction=Input,datatype=varchar,Parametername=@dbname,Parametersize=100

Declare @dbname varchar(100)
set @dbname=?
if exists (select name from sys.tables where name='Mytable') Drop table Mytable
go 
create table mytable (myid int,name varchar(100))
DECLARE @myid int
set @myid=0
While @myid<10
begin
Insert into mytable
values (@myid,'santhosh')
select @myid=@myid+1
end

Package gets exec successfully but the script operation is performed only in Master database. What may be the issue ?





SANTHOSH KUMAR



SSIS Package Execution Fails when large size Excel File is loaded via SSIS Catalog (SSISDB)

$
0
0

Hi - 

I was working on a SSIS Package which simply loads an excel file and it contains no complicated transformations. The SSIS Package executed via Visual Studio 2015 works completely fine. However, when I try to load it via SSIS Catalog (SSISDB), the execution fails. The size of excel source file is (approximately) 2 MB.

If I reduce the number of rows inside the excel source file and bring the file size down to around 1.16 MB, then the file is loaded successfully via SSIS Catalog (SSISDB). The error messages that I am receiving while loading the original excel source file are as follows:-

  • 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: "External table is not in the expected format.".
  • Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager failed with error code 0xC0202009.  

Any help for resolution of this particular issue will be greatly appreciated. Thanks in advance.


SSIS Script Task Error through SQL Server Agent Job - The package execution returned DTSER_FAILURE (1).

$
0
0

Hello Everyone,

I badly need help here. I tried various suggestions from different posts in msdn and others , but nothing work out . I have created a package using SSDT for VS 2013 which has  a script task with VB 2012 code which refreshes Excel workbooks which in turn pull the data from tabular cubes. This works fine when executed in Visual studio. But fails everytime with below error , when run through SQL server agent Job 

Error - 

Executed as user: *****. Microsoft (R) SQL Server Execute Package Utility  Version 12.0.4100.1 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  4:12:44 PM  Error: 2016-08-17 16:13:35.23    Code: 0x00000001     Source: FileName      Description: Exception has been thrown by the target of an invocation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  4:12:44 PM Finished: 4:13:35 PM  Elapsed:  50.562 seconds.  The package execution failed.  The step failed.

Couple of suggestions i have tried 

1) Made sure that the Proxy account has read/write access on the folder where the excel file is present

2) Followed instructions in the below thread and created this folder - C:\Windows\SysWOW64\config\systemprofile\Desktop

https://social.msdn.microsoft.com/Forums/en-US/b81a3c4e-62db-488b-af06-44421818ef91/excel-2007-automation-on-top-of-a-windows-server-2008-x64?forum=innovateonoffice

3) Checked the option in job to run  in 32-bit mode

None of these suggestions work for me . Thanks in Advance. This would be a great help 


SG

Deploying SSIS pacakge with Oracle Attunity connection

$
0
0

We have developed several packages with Oracle Attunity connection (Project level connection). While we deploy this package using SQL server agent the job when runs it fails. This is due to the password is NULL for oracle connection. Our package protection level property is SaveSensitiveDataWithUserKey.

So at this moment what is the correct method to deploy the packages to make it run via SQL server agent.


Sarvan

Timeout in SQL Server

$
0
0

Hi All,

This is related to timeout troubleshooting inside SQL Server. I have below scenario in my env.
3 servers are involved.

Srv1 - here jobs and ssis pkgs are resided.
Srv2 - Source server from where data is pulled from
Srv3 - is the Destination Server where data has to get loaded.

Note: all 3 are SQL2014 servers.

Scenario is: On Srv1 there is a job which is scheduled to run every 4 hours. When the job runs, it calls an SSIS package. Within the SSIS package, there is script task which has some .net code which basically connects to Source i.e. Srv2 server,
pulls data and stored it in a dataset and then connects to destination server (Srv3) and loads data into it.

Issue is the when the job is kicked off on Srv1 server, sometimes it runs fine but many times it fails with timeout issues. But I am not sure it is query timeout or login timeout. In the job history it just says query terminated with timeout.

Information I am looking for?

1. How to get the exact error message of the timeout?
2. How to narrow down where exactly ( i mean, on which of the 3 sql server's) timeout is occuring?
3. Does the login time or query timeout gets logged in SQL server ERRORLOG or any connectivity DMV's/ring buffer?
4. Can we write of log timeout error number,error message and servr name where timeout has occured using custom logging to windows log or any text log file?


Thanks,

Sam

SSIS Lookup from dim that has fromdate and todate

$
0
0

I want to lookup an id from a dim using a lookup transformation and there is fromdate and todate within the dim, so I want to pass a date from the source and do a between lookup on the fromdate and todate within the lookup transformation. Because you have to supply it with parameters in the lookup I cant get it to use the single source date and do a between in the lookup.

At the moment it is only possible to do a single mapping against the source column, Can you suggest a way do a between ?

SSDT BI is not supported on windows 10 ?

$
0
0

I am trying to install SSDT on windows10.

I have windows 10 home premium edition .

As per Microsoft site there is no listing for windows 10 ?

Note : Microsoft doesnt even sell windows 7 anymore and we are forced to use windows 10 .

Supported Operating System

Windows 7, Windows 7 Service Pack 1, Windows 8, Windows 8.1, Windows Server 2008 R2, Windows Server 2008 R2 SP1, Windows Server 2012, Windows Server 2012 R2

    • Supported architectures:
      • 32-bit (x86)
      • 64-bit (x64)

https://www.microsoft.com/en-ca/download/details.aspx?id=42313





ScriptComponent ThreadPool: randomly exits Main method.

$
0
0

Hi all,

Short intro on what I try to do and how I have built it: I need to read a SharePoint list with +6000 listitems and I need to get the versionhistory of each item, which actually means requesting versioning-data for each field of each listitem. Long story short: this results in about 620000 requests that have to be made to the SharePoint Webservices. Doing this in a single-threaded setup would take forever to load, so multi-threading is the way to go. Also, this is still on on Sql 2008 R2, which means .NET 2.0, which means that I can't use the new parallel processing stuff they've added to .NET 4.0, so I figured using the ThreadPool was my easiest way forward.

So, in my main method, I enumerate over all the fields of the listitems, and I made a method (which I'll queue as workitems to the threadpool) that takes the listID, listItemID and fieldname as parameters and that gets the versionhistory of that field. After it has read the versionhistory, it adds this data in OutputBuffer of the ScriptComponent. 

I also created a TaskInfo Class which holds the data object that pass to my ProcessListItemField method when I queue it for the ThreadPool.

So, first, in my main method:

foreach (XmlNode ListItem in results.SelectNodes("descendant::z:row", NamespacesMgr))
        {
            ProcessListItem(ListItem, ListUID);
        }


Which executes this method:

private void ProcessListItem(XmlNode listItem, String ListUID) { String ListItemID = listItem.Attributes.GetNamedItem("ows_ID").Value.ToString(); String ListItemCreatedDateTime = listItem.Attributes.GetNamedItem("ows_Created").Value.ToString(); foreach (XmlAttribute ListItemField in listItem.Attributes) {

//This is where I add the task to get and process the listitems versionhistory to the ThreadPool ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessListItemField), new TaskInfo(Int32.Parse(ListItemID), ListItemField.Name, ListUID, DateTime.Parse(ListItemCreatedDateTime))); workitems = workitems + 1; } }

As you can see in the above snippet, I keep a count of the number of workitems I queue in the integer 'workitems'. This integer is decreased with 1 at the end of each ProcessListItemField that I added to queue.

So, this adds the following method as a task to queue to be executed by one of the available threads in the ThreadPool:

public void ProcessListItemField(Object taskinfo)
    {
        IDTSComponentMetaData100 myMetadata = ComponentMetaData;
        bool fireagain = false;
        try
        {
            TaskInfo taskInfo = (TaskInfo)taskinfo;
            XmlNode ListItemFieldVersionCollection = ListsService.GetVersionCollection(taskInfo.ListUID, taskInfo.ListItemID.ToString(), taskInfo.ListItemField);
            foreach (XmlNode ListItemFieldVersion in ListItemFieldVersionCollection.ChildNodes)
            {
                Output0Buffer.AddRow();
                Output0Buffer.ListItemID = Int32.Parse(taskInfo.ListItemID.ToString());
                Output0Buffer.FieldName = taskInfo.ListItemField; //varchar(500)
                Output0Buffer.Modified = DateTime.Parse(ListItemFieldVersion.Attributes.GetNamedItem("Modified").Value.ToString()); //varchar(50)
                Output0Buffer.Editor = ListItemFieldVersion.Attributes.GetNamedItem("Editor").Value.ToString(); //varchar(1000)
                Output0Buffer.Value = (taskInfo.ListItemField == "ows_Created" ? taskInfo.ListItemCreatedDateTime.ToString() : ListItemFieldVersion.Attributes.GetNamedItem(taskInfo.ListItemField).Value.ToString()); //varchar(Max)
            }
            workitems = workitems - 1;
        }
        catch(Exception ex)
        {
            myMetadata.FireWarning(0, "ScriptComponent", "Error while processing ListItemID " + ((TaskInfo)taskinfo).ListItemID.ToString() + " - " + ex.Message, String.Empty, 0);
        }
    }

Finally, in my main method I do the following to make sure that the main method does not finish before all workitems have been processed by the background threads:

while (workitems > 0)
        {

                int avWorkerThreads;
                int avCompletionPortThreads;
                ThreadPool.GetAvailableThreads(out avWorkerThreads, out avCompletionPortThreads);
                myMetadata.FireInformation(0, "ScriptComponent", " [" + DateTime.Now.ToString("G") + "] - There are currently " + avWorkerThreads.ToString() + " WorkerThreads available.", String.Empty, 0, ref fireagain);
                myMetadata.FireInformation(0, "ScriptComponent", " [" + DateTime.Now.ToString("G") + "] - There are currently " + avCompletionPortThreads.ToString() + " CompletionPortThreads available.", String.Empty, 0, ref fireagain);
                myMetadata.FireInformation(0, "ScriptComponent", " [" + DateTime.Now.ToString("G") + "] - There are currently " + workitems.ToString() + " workitems in the Threadpool.", String.Empty, 0, ref fireagain);


            Thread.Sleep(10000);
        }

This results in a log that looks like this when I'm debugging:



This now all works fine except two issues I'm facing:

  • As you can see, while I have more than enough work in the queue and still +1700 threads available, performance is still pretty bad, about 60-70 requests per 10sec, is there any way to boost this?
  • The script randomly exits: no error, no warning, no exception or whatever, it just exits and says the package is ready. It seems it entirely ignores the while-loop that I inserted in the main method to wait for all the workitems to finish. The screenshot above shows this: no error or finish message at the end of the scriptcomponent-logging while VS shows the message that the job is done. Any ideas on what might be the issue here?

Thanks!

C


Read and write SFTP

$
0
0

Hi there,

I have two tasks in my package that access a SFTP.

Get the files in an input folder, copy the files to a local folder and then move the files in the SFTP to an archive folder.

If I execute it in Visual Studio it works, if I Deploy it to SQL Server and create a Task using the SQL Server Agent it doesn't work.

What I have is:

GetFiles. txt

#option batch on
#option confirm off
open CGI@94.46.13.32
cd /Input
#option transfer ascii
get *.txt \\fslis01\Dados_SSIS\CGI\Input\
#close
exit

MoveFiles.txt

option batch on
option confirm off
open CGI@94.46.13.32
cd /Input
option transfer ascii
mv *.txt ./Archive/
close
exit

In the task:

1. Execute Get Files

Executable: C:\Program Files (x86)\WinSCP\WinSCP.com

Arguments: -script=\\fslis01\Dados_SSIS\CGI\GetFiles.txt

2. Execute Move Files

Executable: C:\Program Files (x86)\WinSCP\WinSCP.com

Arguments: -script=\\fslis01\Dados_SSIS\CGI\MoveFiles.txt

Please can you help solve this issue. Making possible to have it run in SQL Server Agent?

Thanks in advanced,

Ana



xml destination

$
0
0

hi

  I am having table in sql server 2008..now i want to  get XML destination how to do this in ssis

Why on Earth is there no XML Destination?

$
0
0
I've been working w/ SSIS for a while now, and so far, have been able to work around the limitation of SSIS not supporting an XML Destination task (mainly by simply not creating XML files).  And even though I'm a pretty big advocate of SSIS for processing data to and from files, it's becoming increasingly more difficult to justify using SSIS for our file processing needs, when it doesn't even support creating XML files.

I realize there are several "workarounds" available -- using "FOR XML" to create a string from SQL and write to file, using script tasks to build XML and write to file, but all of these are incredibly crude and have limitations.

I found where it was suggested to MS to implement, but for some unknown reason, it's "not into [their] current priorities", and has been marked as "
Closed (Won't Fix)":

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=303815&wa=wsignin1.0

What are they thinking?  If they want SSIS to become an industry standard solution for processing data files, how can they totally dismiss the lack of XML support?

I did find a third party option at:
http://www.keelio.com

But I can't find where anybody is using this at all, so I'm a little leary of that option (though I do plan on downloading the evaluation just to give it a try).

Does anybody have any knowledge of this major limitation in SSIS?  Does MS even hint at adding support for this at some point, or should I abandon SSIS now before we invest too much time and money into a product destined for abandonment by other supporters?  Has anybody looked into third party options (again, outside of the known "workarounds")?

Thanks in advance for any light you can shed on this.
Jerad

Day Comparison Between TY and LY

$
0
0

Hi everyone,

My department supervisor gave me a job to do which is about to produce automatic daily, weekly and monthly reports. A datamart is ready for this process. I have to compare the trend of last year and this year. For the monthly report there is no necessity of day comparison.

However in daily and weekly reports I need that. For example: 1 Aug 2016 corresponds to Monday and according to last year day comparison, it can be compared by 3 Aug 2015 Monday.

Is there any ease or method of this in SSIS?

SQL Server Integration Services on all Windows XP Desktops

$
0
0

I have been asked to review a migration from XP desktops (I know) to Windows 7 or 10.

The audit has identified that the followingtools are installed on all of the XP clients

  1. SISS
  2. SSAS
  3. SSRS
  4. Management Tools

Is this wise? 

What type of licencing is required?

Wouldn't they be better using a central administration server with Terminal services licences.

What is the most appropriate way to deploy these tools to over 25 users for a centrally managed , optimally performing environment or is it OK to deploy these tools directly to desktops  and connect to remote SQL servers?



How to compare two excel files, when one excel file has vertical vertically placed columns and other excel file has horixzontally placed columns?

$
0
0

Hi All,

I am trying to use SSIS to compare to excel files. But the challenge here I am facing is, one excel file has the columns placed vertically and not the usual case of horizontally. When I take this excel file as Excel source, it is taking only the columns as f1, f2,f3,f4 .... etc. But I want to specify the columns in the excel which are placed vertically as shown in the figure below.

As shown below, I need to map the columns from this excel as highlighted in yellow. But SSIS excel source is not taking tem as columns. Is there any way I can make SSIS take these as there columns?


Rahul


How can I save the path and the file for a plain file destination?

$
0
0

Hi,

I'd need to save the full path and file name because after processing the output, this output must be transferred by using FTP Task

Thanks in advance,


Error when loading data from SAP R3 to SQL BI

$
0
0

Hi everyone,

we have extracted a very big Table BSEG from R3 to SQL BI. However there is an Error when loading:

ERPConnect.ERPException:CPIC-CALL: MRCV: rc= ...

LOCATION CPIC (TCP/IP) on local host

ERROR ilegal parameter value (function=SAP_CMTIMEOUT2/parameter=conversation_ID/value=.....)

TIME:....

RELEASE ....

COMPONENT CPIC

VERSION...

MOUDLE

LINE

COUNTER

-RFClisten failed: RFC_FAILURE

at ERPConnect.RFCAPI.ReceiveFunctionResult(Ulnt32 connectionhandle,RFC_PARAMETER importing,RFC_PARAMETER changing,RFC_TABLE,encoding apiendcoding)

at ERPconnect.RFCFunction.REceiveFunctionArguments(RFC_Table&apiTables)

atERPconnect.RFCFunction.CallclassicAPI

atERPconnect.RFCFunction.ExecuteRFC Byte tid

at XtractKernel.Extractors.TableExtractor.Getpackage(RFCFunction&func)

at XtractKernel.Extractors.TableExtractor.Extract

at XtractKernel.Extractors.ExtractorBase1.Extract(ProcessResultCallback processResult)

after checking SQL BI system, there is no Error with the System, so we think there is something wrong with the RFC Connection between ERP and SQL BI. i have checked the connection but i couldn't find any Problem with it.

Can you please help me how to solve this Error?

Thankyouvery much!



how to import data(from Sheet 1) from multiple excel files to multiple columns of a single tablesql tables

$
0
0

I have a specific task and trying to figure out a solution ..
I have a client folder that gets loaded with an excel file for every month. It has multiple sheets but I need to pull just 1 sheet(same columns) from every excel file and load in to a same table.

Every sheet has 2 columns (State and Col2).

Month1

STATE

COL2

TX

.62

PA

.82

VA

.92

Month2

STATE

COL2

TX

.22

PA

.32

VA

.42

and so on..

Col 2 is the percentage column which I need to load to database to calculate average on that column and report.
Can you please guide how to perform this task.

Thanks in advance

Pull data from Redshift

$
0
0

Hi,

We want to pull data from Redshift database into SQL Server. Currently, we are using SQL Workbench to analyze Redshift database. We referred the following link -

Connect Your Cluster By using SQL Workbench

Here we used - RedshiftJDBC41-1.1.17.1017 driver to connect. Now we want to push this data to DWH in SQL Server 2016.

So what is the best way to accomplish this? There is not much information on net on how to pull data from Redshift.

Can we have SSIS component or something in SSDT/SSIS2015 to load this data?

Till now I came across only the Zappysys Data Transformation third party toll which is able to conect to Redshift via SSIS. 

ZappySys Transformation to connect to Redshift

Can't we directly connect to Reshift using native SSIS 2015 without any third party tool?

Thanks in advance. 

Prevent SSIS Number Rounding

$
0
0

Hi ,

   I am facing a strange issue using SSIS and need some help in this regard. Le me first set the context. I have a simple package that is used to load an excel file content into a SQL Table. There is a script component used to  achieve this since the data from the excel should be unpivoted and loaded into the table in SQL Server. We are using Provider=Microsoft.ACE.OLEDB.12.0;Data Source=filePath;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1"  as a driver to connect to the excel and load. The excel file as some string columns and few numeric columns. We are facing an issue while loading the numeric columns. We are reading the numeric columns also as DT_STR and mapping this to a target column which is a Decimal type. The intention is to get the number as it is given in the file without rounding off or truncating. There is a number0.055464 which is getting rounded off to 0.0555 which is not acceptable. What is more surprising is I have copied the same project to another environment(UAT) and execute it there the number is getting loaded as 0.055464 as expected. The UAT environment also uses the same drivers and the connection strings as mentioned above. Any help to troubleshoot this will be much appreciated.

Thanks,

Pavan

HTTP Connection Manager - file size > 2GB = blank file

$
0
0

Hi, I'm using this in SSIS SQL Server 2008 R2 to download a file

Recently the file size has increased >2 GB.

The downloaded file is now blank - it produces a file of about the right size but full of blank lines (CR LF with nothing in between).

Anyone else seen this or can suggest what the issue is?


Viewing all 24688 articles
Browse latest View live


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