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

Derived Column - Evaulate Is Not Null in an IF Then Statement

$
0
0

Greetings,

I currently have a table with the following columns:

Select
account (varchar (30))
,LP_Date_Next date
,PP_Date_Next date
,IP_Date_Next date
,PIP_Date_Next date
Bullet (varchar (3))
from table

I'm trying to create a derived column which evaluates the Date_Next columns. 

If LP_Date_Next is not null and PP_Date_Next, IP_Date_Next, and PIP are null then it should read "Regular Payment."

If PP_Date is not and all other *Date_Next are null, then it should be "Principal Only."

I started to write the expression in SSIS on a derived column, but it's beginning to look quite convoluted since evaluating only if the field is Null instead of evaluating if the field is not null, but I don't know how to proceed with it.

This is what I have so far:

(DT_STR,50,1252)(ISNULL(PP_Date_Next) && ISNULL(IP_Date_Next) && ISNULL(PIP_Date_Next) ? (DT_WSTR,50)"Regular Pay" : ISNULL(LP_Date_Next) && ISNULL(IP_Date_Next) && ISNULL(PIP_Date_Next) ? (DT_WSTR,50)"Principal Only" : (DT_WSTR,50)"nope")

I've only gotten to write the expression to evaluate if the account is Regular Pay or Principal Only. I also need to evaluate when an account IS NOT NULL for example on PP_Date_Next and IP_Date_Next.

I'd really appreciate if someone can guide me to identify if it's possible to use NOT Null as opposed to evaluating with ISNull.

Thank you in advance,

Jeannette


package config file + all connections to all databases in one xml file

$
0
0

Hi,

Planning to have one .dtsconfig file for all connections to all databases and use it in all packages like this

<DTSConfiguration>
 <Configuration ConfiguredType="Property" Path="\Package.Connections[cn1].Properties[ConnectionString]" ValueType="String">
    <ConfiguredValue>Data Source=localhost;Initial Catalog=dbA;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;</ConfiguredValue>
   </Configuration>
 <Configuration ConfiguredType="Property" Path="\Package.Connections[cn2].Properties[ConnectionString]" ValueType="String">
    <ConfiguredValue>Data Source=localhost;Initial Catalog=dbB;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;</ConfiguredValue>
   </Configuration>
 <Configuration ConfiguredType="Property" Path="\Package.Connections[cn3].Properties[ConnectionString]" ValueType="String">
    <ConfiguredValue>Data Source=localhost;Initial Catalog=dbC;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;</ConfiguredValue>
   </Configuration>
</DTSConfiguration>

Package 1 has only cn1 connection manager.

Package 2 has only cn2 connection manager etc.

When I run package 1, everything works fine but in logs, I see that

Error:

The connection "cn2" is not found. This error is thrown by Connections collection when the specific connection element is not found.

The connection "cn3" is not found. This error is thrown by Connections collection when the specific connection element is not found.

How can I have only one xml config file for all database connections. I was to use this config file by all packages.

Thanks,

SSIS - Common functionality and multiple packages

$
0
0

Hello,

I need to create Send Email functionality in SSIS and need to be used it at multiple places.

So instead of using it directly in package, can i create common package use it as template (??) and then while creating other package just call Send Email package

Yes, i need to create common variables which are used in Email which will be common across all packages to pass value required by Send Email package 

Possible?

If Yes then how ?

If Yes/No, Any other way to achieve this?

This is just a example, we have different business requirements which are similar to above.


Technical Project Manager cum Architect

Syntax Misstake for Simple Conditional Derived Column Expression

$
0
0

Greetings,

I need assistance in correcting my Syntax. I have a new column that I named facility, and I’d like to place the facility initials in that new column which are contained within the ID field.

This expression works (but it only pulls one 1 of the 3 facilities)

ID == "DRMC"?  "DRMC":""   (This one works by itself)

I tried to nest all 3 facilities within this expression but it is not working for me.

ID == "DRMC"?  "DRMC": (ID == "FLH"? "FLH:(ID == "FCH"?"FCH":""))

Thanks in advanced for pointing me in the right direction

Access SSISDB Catalog Environment at design time

$
0
0

Hi,

I was wondering if there's any method to access or import catalog environments during design.

In package deployment mode, we used an XML config file.  The XML file was different on each server and contained about 20 different connection strings and other values.  If you opened the package on the server (or just changed the XML file on your PC) and executed it through the GUI, it would get the values from that XML file.

Now with project deployment mode, I don't set the environment variables (which overwrite the project parameters) until the project is deployed.  So I can't just open the solution, run it from the designer and have it pick up the necessary parameters. I need to manually change the project parameters to values that match the environment I want.

So I'm hoping there is some way around this, by importing the environment into project parameters in the designer or something (thought maybe that would be a feature of BIDS Helper but doesn't seem to be the case).  Any ideas, or am I out of luck?

Thanks,

Scott

removing duplicates after data is already sorted

$
0
0
Hi we run 2012 enterprise.  In my data flow my data already comes in sorted on col 1, col 2, col 3.  I'd like to add a multicast to the pkg and follow that multicast by something that will reduce the data to just non duplicated combos of col 1 and col2 without resorting the data.  Is that possible without a c# script? My recollection is that c# creates pushback in the buffer.

Using Merge to update column

$
0
0

HI

I have a requirement like below:

Table : Table1

ID1    ID2    ID3    IsArchived

1       2        3        0

1       2        4       0

1       2        5       0

2      3       1       0

2      3       2       0

For a combination of ID1 and ID2 there can be multiple entries of ID3.

I want to use Merge statement to handle insert/delete(Isarchived=1) for this:

MERGE  [dbo].[Table1] AS target
USING (SELECT * FROM @DocumentTypeIDList) AS source
ON
source.ID1 = target.ID1
AND source.ID2 = target.ID2
AND source.ID3 = target.ID3
WHEN NOT MATCHED BY TARGET THEN
INSERT (
)
VALUES(source.ID1
  ,source.ID2
  ,source.ID3
  ,GETDATE()
  ,0
  )
WHEN NOT MATCHED BY SOURCE THEN
UPDATE 
SET [IsArchived] = 1

@DocumentTypeIDList :  is input param which will always contain multiple ID3 values for a single combination od ID1 and ID2?

The issue that i am facing is when the rows in source don't match with target it sets IsArchived=1 for all UserID and CompanyID values, whereas i want only that specific UserID and CompanyID nonmatching rows to be updated to IsArchived=0.Is there a way i can achieve this using merge or do i need to go for separate insert/update statements?

Thanks

Date Parameters in SQL Server Job

$
0
0

Hi guys,

I have an SSIS package that I want to be executing using SQL Server job. The major challenge I have is that the package loads transaction from SQL Server data source for a specific date range which is not uniform. And each time I want to execute the package I have to go the SSIS package to manually change the date range.

Is there a way I can change this date range (in the SQL Server Job) without going to the SSIS package each time I want to run the package.


me


Add comments in the expression written in derived column transformation.

$
0
0

I am using an expression in derived column transformation to set the value of a variable.

I further override the value of this variable , so I want to add a comment in the expression (where that variable's value is set)

to let other people know that this variable's value is set later.

Please help , how I can I add comment in derived column transformation's expression.

SSIS2012: RunId variable "Failed to lock" at runtime - BOMBS 0xC0010001

$
0
0

Searching the CODE for the entire stand-alone package revealed ZERO occurrences of the variable "RunID" cited in the following FAILURE message:

tsql BEGIN TRAN 3:Error: Failed to lock variable "RunId" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".

I've found several posts citing "RunID", many of which are simply the name of a column returned from a user query, but there are some that contain the same message as above.  However, aside from one saying "did you change the package" that is marked as an answer (how?) there is no help for this problem.

Please help as this package runs every 15 minutes, is crucial to the business, and I cannot tell from this what to do or where the package logic was up to (a for-each loop on around 200 items).

Thanks in hopes...


Ldap data load failed after loading 1000 records

$
0
0

Hi All,

I have defined an LDAP connection in SSIS and used it in my package. It is getting failed after loading 1000 records. Is there any limit for the LDAP Connection manager? If yes, is there a way to load all the records? There are records more than 1000 but not sure why this is failing. Any help regarding this issue is appreciated.

Altering credential ##xm_cmdshell_proxy_account## for xp_cmdshell

$
0
0

Current situation We have - 2 SQL Server 2014 instances (including the latest service packs)
- each on a different Window 2012R2 machines. - with each a different windows accounts for the ##xm_cmdshell_proxy_account##.

On both systems the xp_cmdshell works completely fine.

Important not: One account is: - the AD Administrator - and the other one is a normal Active Directory account with administrator privileges (lets call this one NormalAdmin).

Change Because both are windows administrators we like to change them to non-administrator accounts.

There has been created an new account for this goal. - It has rights to run applications on the places where it needs to - It has rights to access and modify files in the filesystem - It has access to the databases it needs to - The account is member of the master database - And is granted rights to run the xp_cmdshell command

But: - It still cannot perform dir commands - Or run bat-files

Questions Because all the steps mentioned in manuals have been taken, I am not able to make the question more clearer than: - So, what to do next?

SQL Server 2012 SSIS - Export to File Error: Cannot open the datafile...

$
0
0

Greetings,

    I am running into an issue when deploying a SSIS Package to SQL 2012 and running it manually from SSMS.  I get the error Export to File Error: Cannot open the datafile... when trying to have it create an XML file based on data in the database. The folder has permissions set up for everyone to read or write to and I verified the connection for the SSIS package is running my credentials.

    Within Visual Studio, the SSIS packages runs just fine and create files on the same folder that is defined when it is deployed to SQL Server. 

    Not sure what I need to check or look at to see why it works in Visual Studio but does not work when deployed.  Any assistance would be appreciated.

Thanks


Lou Davis Software Engineer E2B Teknologies

SSIS package replacing varchar data from Sybase with single blank... but only when run in a SQL job

$
0
0

Hello,

I've run into a weird problem where some data being copied to a SQL 2014 db is getting overwritten along the way but a single space... in each row (13,769 rows)... and it only occurs when the package is run in a SQL job. It works fine if I run it using the package execution utility or within the SSIS designer on another machine.

There are two other columns being copied across in this package but they are INT and are coming across fine.

The connection to Sybase is via the v15.7 ASE OLE-DB driver.

This package was running OK in a similar test environment for weeks without any issues and it was only when it went to Prod that we ran into this issue... grrr.

Thanks,

Martin V.

How to clear Lookup Transformation Buffer Cache in SSIS2005

$
0
0

Hi all,
i wonder is there anyway to clean the buffer cache of Lookup Transformation editor after running DataFlow task with lookups.
i am using SSIS 2005
Thanks in advance.

Cem Uney

cemuney

does conditional split preserve order

$
0
0
Hi we run 2012 enterprise. Is the order of data coming into a conditional split preserved?

csv file in object variable

$
0
0
i am using Zappysys ssis component,  able to download csv from url and stored it in SSIS varibale (as object).

is it possible to read object variable (csv formatted data) in script source component.

Idea is , i don't want to store CSV fle in file system then use it as Source in transfromation,  trying to do in variable as source
Thank
V

How to stop propagating validation errors?

$
0
0

Hi,

I need to stop the propagation of errors from some transformation to the package, i.e., if some transformations fail I want to continue the processing and return success when the process ends.

I've several sequence containers that implement the business rules, some of them are independent from the others, so if the "content" of the container fails must not fail the all processing.

I've add some tests with SQL tasks, using the onEvent event and the propagation system variable, and it works, please see next image,

But my problem is on a Data Flow Task, if  someone changes the data structure or delete the source table, the Data Flow Task fails due to the validation check... and the error is propagated to the parent containers and to the package.. and the package fails.

see next image,


my question is, how can the processing ignore that kind validation error? if the source table is not there or someone has changed the structure of the table... how we might change the configuration to don't fail the container and the package.

Note: the Execute SQL task only does a division by 0 : Select 1/0. the Data Flow Task extract data from one table and load a variable using a dataset, to fail the data flow task I changed the source data structure dropping 2 columns.

Many Thanks, Luis

Split the names in derived column in SSIS

$
0
0

 Hi,

         I have a question regarding splitting column in SSIS dervied coulmn. There is a space between two names .

Eg:  Tom Tester

I need to Split the column  Tom as FirstName and Tester as Last Name . How this can be done in derived column ?


Anita

SSIS package design to accomodate 2 additonal french csv files for current package which processes only english versions

$
0
0

Hi All,

I have a package which loads 2 english csv files and below diagram shows the current design of the package is.


The current logic involves loading 2 english files using 2 flows(sequence containers) separately after the files have been downloaded into a import/input folder by an external SFTP process.

I use a flat file source to load the CSV files in separate sql server english tables .

If there are any rejects I route them to a flat file with entire row ,error column and error and have defined separate connection mangers specifically for each of the 2 file loading process.After loading them I delete them using file system task pointing to same source connection which I use for loading.

Now I will be getting 2 additional french files and I need to load them in two separate french tables.I would like to know the best solution design for adding 2 additional french version files .

I m thinking to create a separate package as if I had 2 files to existing design I will have to define the below and may be additional stuff .Hence want to know for a requirement like this would you like to have separate packages to isolate issues and troubleshoot when they are in production or would you like to have everything in the same package?

1.2 Flat file connection managers to route bad records 

2. 2 send mail tasks 

3. Additional variables to hold the new files and row count variables ( records > 0)for send mail task .

I see complexity added to development if I use existing package .





Viewing all 24688 articles
Browse latest View live


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