Showing posts with label parent. Show all posts
Showing posts with label parent. Show all posts

Thursday, March 29, 2012

Default Logging (UseParentSetting) function works for the immediate child packge ONLY

I am not sure if this is a bug or not, but we have found that only the immediatelly called child package inherits the parent logging option, and others called byond the immediate child will loose the settings. For instance, say you have three packages, pkg1 will specify logging (checked events that will be logged), pkg2(which is called from pkg1) will see (by default) the checked events from pkg1, but pkg 3(which is called from pkg2) won't. You will have to manually check the logged events or load an existing settings file. This would be fine if you were dealing with just a few called packages, but for some cases (ours included) this would prove to be quite a pain having to manually check all the sub pkgs that didn't inherit the parent.

Is this a bug? Any easier ways of incorporating logged events in all of the sub-sub pkgs without manually checking the events?

Thanks in advance...

I think my problem is more in depth then I originally illustrated. When you define logging, (the provider and log connection) does this get inherited by other child packages, or must you define a provider/connection for every package?

|||I posted a similar question about logging, but I think I didn't ask it properly.

When you set LoggingMode=enabled and define the provider and checked events in the pkg(parent), don't any and all child packages inherit these properties as long as LoggingMode=UseParentSetting?

We setup and configured one pkg for logging, then set all sub pkgs to UseParentSetting, but when we would run the pkgs, the other pkgs below the immediatelly called child wouldn't get logged. So, pkg1(enabled logging) would call pkg2(useparent), then pkg2 called pkg3(useparent), and so on -- pkg1 and pkg2 would log, but 3,4,5... wouldn't.

When we check logging settings under pkg3(so on...) the events were not checked, we manually tried to check them but it created a unique logging pkg (LoggingMode=enabled).

Are we missing something here?|||

[Threads merged]

The LoggingMode setting is only for enabling and disabling the logging. It's only that distinction which can be inheritted from the parent. I.e., your choices are:

Enable logging on this package|||That's what I thought, unfortunatelly though, it doesn't log the other child packages as illustrated in my earlier post. Maybe, SeptCTP has some bugs in logging? We will try this scenerio on the RTM and see...

Thanks,

Saturday, February 25, 2012

deceptively simple join / select question

Ok, I have two tables with a child/parent or one -> many relationship:

parent_table:
pid int primary key
pname varchar

child_table:
cid int primary key
pid int
cname varchar

Say the contents of these two tables are:

parent_table:
pid pname:
1 Ben
2 Jesse
3 Michael

child_table
pid cid cname
1 1 ben_Child1
1 2 ben_Child2
1 3 ben_Child3
2 4 jesse_Child1
2 5 jesse_Child2
2 6 jesse_Child3
3 7 michael_Child1
3 8 michael_Child2
3 9 michael_Child3

Now what I would like to be able to do is:

select pname, cname
from
parent table a,
child_table b
where a.pid = b.pid

Except! Instead of getting the results in the form of:

Ben ben_Child1
Ben ben_Child2
Ben ben_Child3
...

I would like them in

Ben ben_Child1 ben_Child2

Now normally this would be impossible (I think) since the query would return an unknown number of columns. But in this case I only care about the FIRST TWO children for each parent. So I'm sure there's some way to do this with a simple select, but I don't know how. Anyone?Are you trying to get everything from both tables in the form pname cname? If so what about a Cross Join?

Originally posted by blm14_cu
Ok, I have two tables with a child/parent or one -> many relationship:

parent_table:
pid int primary key
pname varchar

child_table:
cid int primary key
pid int
cname varchar

Say the contents of these two tables are:

parent_table:
pid pname:
1 Ben
2 Jesse
3 Michael

child_table
pid cid cname
1 1 ben_Child1
1 2 ben_Child2
1 3 ben_Child3
2 4 jesse_Child1
2 5 jesse_Child2
2 6 jesse_Child3
3 7 michael_Child1
3 8 michael_Child2
3 9 michael_Child3

Now what I would like to be able to do is:

select pname, cname
from
parent table a,
child_table b
where a.pid = b.pid

Except! Instead of getting the results in the form of:

Ben ben_Child1
Ben ben_Child2
Ben ben_Child3
...

I would like them in

Ben ben_Child1 ben_Child2

Now normally this would be impossible (I think) since the query would return an unknown number of columns. But in this case I only care about the FIRST TWO children for each parent. So I'm sure there's some way to do this with a simple select, but I don't know how. Anyone?|||Originally posted by JODonnell
Are you trying to get everything from both tables in the form pname cname? If so what about a Cross Join?

No, a cross join would give me EVERYTHING. I am trying to get a subset of the results but in addition I am trying to map two rows to two columns eg instead of:

pname1 cname1
pname1 cname2

I want:

pname1 cname1 cname2|||Originally posted by blm14_cu
No, a cross join would give me EVERYTHING. I am trying to get a subset of the results but in addition I am trying to map two rows to two columns eg instead of:

pname1 cname1
pname1 cname2

I want:

pname1 cname1 cname2

What about GROUP BY:

Select p.*,c.* From Ptable P Join Ctable C ON P.pid = C.pid Where [P.pid = C.pid] GROUP BY P.pid

Sorry for the mess but it's almost 5.

John|||Still no good. The group by wont help because I'm not doing any sums or avgs or counts or anything. Adding the group by wont change the results at all actually, from what I know.|||I was bored.

I think this is what you're looking for

Rgds,
Jim.

declare @.d_id int;
declare @.c_name varchar(100);
declare @.c_arr varchar(2000);
declare @.tmp varchar(100);

declare @.x table([id] int, [name] varchar(2000))

DECLARE d cursor for
select depid
from dept;

OPEN d
FETCH NEXT FROM d INTO @.d_id
WHILE @.@.FETCH_STATUS = 0
BEGIN
set @.tmp='';
set @.c_arr='';

DECLARE c CURSOR FOR
SELECT name
FROM emp
where deptid = @.d_id

OPEN c
FETCH next from c into @.c_name
while @.@.fetch_status = 0
BEGIN
print @.d_id
print @.c_name

set @.tmp = @.c_arr
set @.c_arr = @.c_name+','+@.tmp
fetch next from c into @.c_name
END
CLOSE c
DEALLOCATE c
if (len(@.c_arr)>1)
begin Insert @.x values(@.d_id, substring(@.c_arr,1,len(@.c_arr)-1))end

FETCH NEXT FROM d INTO @.d_id
END
CLOSE d
DEALLOCATE d

select id, name as name from @.x
GO|||You might check yesterday's thread (http://www.dbforums.com/t989683.html) on this topic.

-PatP

Friday, February 24, 2012

Debugging Parent / Child Packages

Hi there,

I have a Business Intelligence project containing 4 packages. One of the packages is a parent package that just runs the other 3 packages sequentially (passing in variables via Package Configurations).

When I set the properties of the Execute Package tasks in the parent package, it seems that I can only select SQL Server or File System locations for the child packages.

What I want to do is for the parent to run the packages in the Visual Studio Project so that I can debug the whole process. I don't want to be bothered deploying the child packages so that I can run them from the parent, at least not while I am debugging the whole process.

How do I get the children to run within Visual Studio as well as the parent? I can't for the life of me find anything on the MSDN about this.

Many thanks in advance.

Richard F

I am not sure what your problem is. If I execute the parent package in BIDS; all children packages are open and execute in debug mode as well. At least that is the behavior I get when storing the packages in .dtsx files; I don't know if the behavior is diffrent when storing them in the DB.

|||Hi there,

Thanks for your reply.

Can I ask what you do when you create the parent package?

I did the following:
- Added an "Execute Package" task to the parent
- Edited properties of the task
- Set the location to File System
- Added a new connection manager of type File Connection and pointed this to the location of the child package in the development folder (i.e. the folder used by the VS.NET package project)
- Set the connection of the parent package equal to this connection manager

Then when running the parent package in VS.NET, it did not step into the child package as you described, and to be honest I'm not really surprised since at no point when specifying the child package from the parent did I tell it to run in VS.NET.

How did you reference the child package from the parent?

Many thanks in advance.

Richard F|||It's real simple. In the parent package, use an Execute Package task to call your child package. Double click on the Execute Package task, and select the package you want to run.

Then, when you are in the parent package, you can run the debug (start button, or F5, I think) which will start the child package accordingly.

Debugging Parent / Child Packages

Hi there,

I have a Business Intelligence project containing 4 packages. One of the packages is a parent package that just runs the other 3 packages sequentially (passing in variables via Package Configurations).

When I set the properties of the Execute Package tasks in the parent package, it seems that I can only select SQL Server or File System locations for the child packages.

What I want to do is for the parent to run the packages in the Visual Studio Project so that I can debug the whole process. I don't want to be bothered deploying the child packages so that I can run them from the parent, at least not while I am debugging the whole process.

How do I get the children to run within Visual Studio as well as the parent? I can't for the life of me find anything on the MSDN about this.

Many thanks in advance.

Richard F

I am not sure what your problem is. If I execute the parent package in BIDS; all children packages are open and execute in debug mode as well. At least that is the behavior I get when storing the packages in .dtsx files; I don't know if the behavior is diffrent when storing them in the DB.

|||Hi there,

Thanks for your reply.

Can I ask what you do when you create the parent package?

I did the following:
- Added an "Execute Package" task to the parent
- Edited properties of the task
- Set the location to File System
- Added a new connection manager of type File Connection and pointed this to the location of the child package in the development folder (i.e. the folder used by the VS.NET package project)
- Set the connection of the parent package equal to this connection manager

Then when running the parent package in VS.NET, it did not step into the child package as you described, and to be honest I'm not really surprised since at no point when specifying the child package from the parent did I tell it to run in VS.NET.

How did you reference the child package from the parent?

Many thanks in advance.

Richard F|||It's real simple. In the parent package, use an Execute Package task to call your child package. Double click on the Execute Package task, and select the package you want to run.

Then, when you are in the parent package, you can run the debug (start button, or F5, I think) which will start the child package accordingly.