Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Wednesday, March 21, 2012

delay in running the sub-packages

Hi,
when call a sub-package from the parent package with the executeoutofprocess=true I have about 5-10 sec delay before sub-package starts running. ( this is a big delay for me as the sub_package is in a foreach loop)
the sub_package itself it's very simple and contains just one script task with a small script in in it.
even if this delay is for validation I still can't understand why it is taking 5-10 ses.
cheers

Kolf wrote:

Hi,
when call a sub-package from the parent package with the executeoutofprocess=true I have about 5-10 sec delay before sub-package starts running. ( this is a big delay for me as the sub_package is in a foreach loop)

the sub_package itself it's very simple and contains just one script task with a small script in in it.
even if this delay is for validation I still can't understand why it is taking 5-10 ses.
cheers


I have to add that the subpackage has got some variables which is specified in package configurations
|||

Have you tried executeoutofprocess = false? Do you have the same delay?

|||And delayvalidation = true?

Friday, February 24, 2012

Default values

I have a table call Master and a table called Rental. They both have a
status field that are named differently. What i want to happen is for the
Status in the Rental table to default to whatever the status is in the
Master table whenever it is imported to the Rental table. ANyone have any
suggestions for this. I dont even know where to start. Thanks>whenever it is imported to the Rental table
What do you mean by imported? What process is running?
One possible answer to your question, if my guess work happens to on
target:
INSERT Rental (A, B, C)
SELECT A, B, X
FROM Master
Roy
On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
<ben.watts@.aaronnickellhomes.com> wrote:
>I have a table call Master and a table called Rental. They both have a
>status field that are named differently. What i want to happen is for the
>Status in the Rental table to default to whatever the status is in the
>Master table whenever it is imported to the Rental table. ANyone have any
>suggestions for this. I dont even know where to start. Thanks
>|||It already holds the specific jobnumber in master but whenver a user enters
that specific job into the rental table via infopath I want it to
automatically take on the status from the master table. But allow it to be
changed in the rental table later. So basically just the first default and
then after that i want to be able to change it manually and it leave it like
that
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
> >whenever it is imported to the Rental table
> What do you mean by imported? What process is running?
> One possible answer to your question, if my guess work happens to on
> target:
> INSERT Rental (A, B, C)
> SELECT A, B, X
> FROM Master
> Roy
> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have any
>>suggestions for this. I dont even know where to start. Thanks|||I pretty much need taken thru this all the way, like where do I insert that
code?
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
> >whenever it is imported to the Rental table
> What do you mean by imported? What process is running?
> One possible answer to your question, if my guess work happens to on
> target:
> INSERT Rental (A, B, C)
> SELECT A, B, X
> FROM Master
> Roy
> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have any
>>suggestions for this. I dont even know where to start. Thanks|||Two approaches. One is to write a subquery into the INSERT into the
Rental table. It might vaguely resemble something like:
INSERT Rental (jobnumber, B, RentalStatus)
SELECT 12345, B,
(select MasterStatus from Master
where master.jobnumber = '12345')
The other approach is an INSERT trigger on the Rental table, which
would include something like:
UPDATE Rental
SET RentalStatus = (select MasterStatus from Master
where master.jobnumber = Rental.jobnumber)
WHERE Rental.jobnumber IN
(select jobnumber from INSERTED)
Roy Harvey
Beacon Falls, CT
On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
<ben.watts@.aaronnickellhomes.com> wrote:
>It already holds the specific jobnumber in master but whenver a user enters
>that specific job into the rental table via infopath I want it to
>automatically take on the status from the master table. But allow it to be
>changed in the rental table later. So basically just the first default and
>then after that i want to be able to change it manually and it leave it like
>that
>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
>> >whenever it is imported to the Rental table
>> What do you mean by imported? What process is running?
>> One possible answer to your question, if my guess work happens to on
>> target:
>> INSERT Rental (A, B, C)
>> SELECT A, B, X
>> FROM Master
>> Roy
>> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have any
>>suggestions for this. I dont even know where to start. Thanks
>|||I f I did a trigger would it allow me to change the value whenever I wanted
and allow me to keep the change?
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.4ax.com...
> Two approaches. One is to write a subquery into the INSERT into the
> Rental table. It might vaguely resemble something like:
> INSERT Rental (jobnumber, B, RentalStatus)
> SELECT 12345, B,
> (select MasterStatus from Master
> where master.jobnumber = '12345')
> The other approach is an INSERT trigger on the Rental table, which
> would include something like:
> UPDATE Rental
> SET RentalStatus => (select MasterStatus from Master
> where master.jobnumber = Rental.jobnumber)
> WHERE Rental.jobnumber IN
> (select jobnumber from INSERTED)
> Roy Harvey
> Beacon Falls, CT
> On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
> <ben.watts@.aaronnickellhomes.com> wrote:
>>It already holds the specific jobnumber in master but whenver a user
>>enters
>>that specific job into the rental table via infopath I want it to
>>automatically take on the status from the master table. But allow it to
>>be
>>changed in the rental table later. So basically just the first default
>>and
>>then after that i want to be able to change it manually and it leave it
>>like
>>that
>>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>>news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
>> >whenever it is imported to the Rental table
>> What do you mean by imported? What process is running?
>> One possible answer to your question, if my guess work happens to on
>> target:
>> INSERT Rental (A, B, C)
>> SELECT A, B, X
>> FROM Master
>> Roy
>> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for
>>the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have
>>any
>>suggestions for this. I dont even know where to start. Thanks
>>|||What is wront with this trigger?
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [Rental_Statustrig]
ON [dbo].[Rental_Info]
Update Rental_Info
Set Rental_Status =
(select job_status
from Master
where Master.wwpjobnumber = Rental_Status.wwpjobnumber)
where Rental_Info.wwpjobnumber IN
(select wwpjobnumber
from Master)
END
GO
"Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
news:uRgS3n9tGHA.3964@.TK2MSFTNGP04.phx.gbl...
>I f I did a trigger would it allow me to change the value whenever I wanted
>and allow me to keep the change?
> "Roy Harvey" <roy_harvey@.snet.net> wrote in message
> news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.4ax.com...
>> Two approaches. One is to write a subquery into the INSERT into the
>> Rental table. It might vaguely resemble something like:
>> INSERT Rental (jobnumber, B, RentalStatus)
>> SELECT 12345, B,
>> (select MasterStatus from Master
>> where master.jobnumber = '12345')
>> The other approach is an INSERT trigger on the Rental table, which
>> would include something like:
>> UPDATE Rental
>> SET RentalStatus =>> (select MasterStatus from Master
>> where master.jobnumber = Rental.jobnumber)
>> WHERE Rental.jobnumber IN
>> (select jobnumber from INSERTED)
>> Roy Harvey
>> Beacon Falls, CT
>> On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>It already holds the specific jobnumber in master but whenver a user
>>enters
>>that specific job into the rental table via infopath I want it to
>>automatically take on the status from the master table. But allow it to
>>be
>>changed in the rental table later. So basically just the first default
>>and
>>then after that i want to be able to change it manually and it leave it
>>like
>>that
>>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>>news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
>> >whenever it is imported to the Rental table
>> What do you mean by imported? What process is running?
>> One possible answer to your question, if my guess work happens to on
>> target:
>> INSERT Rental (A, B, C)
>> SELECT A, B, X
>> FROM Master
>> Roy
>> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for
>>the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have
>>any
>>suggestions for this. I dont even know where to start. Thanks
>>
>|||If it is an INSERT trigger it will only execute when rows are
inserted. It would have to be an UPDATE trigger to mess up your
changes.
Roy
On Fri, 4 Aug 2006 10:24:12 -0500, "Ben Watts"
<ben.watts@.aaronnickellhomes.com> wrote:
>I f I did a trigger would it allow me to change the value whenever I wanted
>and allow me to keep the change?
>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.4ax.com...
>> Two approaches. One is to write a subquery into the INSERT into the
>> Rental table. It might vaguely resemble something like:
>> INSERT Rental (jobnumber, B, RentalStatus)
>> SELECT 12345, B,
>> (select MasterStatus from Master
>> where master.jobnumber = '12345')
>> The other approach is an INSERT trigger on the Rental table, which
>> would include something like:
>> UPDATE Rental
>> SET RentalStatus =>> (select MasterStatus from Master
>> where master.jobnumber = Rental.jobnumber)
>> WHERE Rental.jobnumber IN
>> (select jobnumber from INSERTED)
>> Roy Harvey
>> Beacon Falls, CT
>> On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>It already holds the specific jobnumber in master but whenver a user
>>enters
>>that specific job into the rental table via infopath I want it to
>>automatically take on the status from the master table. But allow it to
>>be
>>changed in the rental table later. So basically just the first default
>>and
>>then after that i want to be able to change it manually and it leave it
>>like
>>that
>>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>>news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
>> >whenever it is imported to the Rental table
>> What do you mean by imported? What process is running?
>> One possible answer to your question, if my guess work happens to on
>> target:
>> INSERT Rental (A, B, C)
>> SELECT A, B, X
>> FROM Master
>> Roy
>> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for
>>the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have
>>any
>>suggestions for this. I dont even know where to start. Thanks
>>
>|||Please do not make duplicate posts. You only waited one minute for a reply
before you decided to start a new thread with the same question.
The word END should not be included.
--
HTH
Kalen Delaney, SQL Server MVP
"Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
news:etGT709tGHA.2172@.TK2MSFTNGP05.phx.gbl...
> What is wront with this trigger?
> SET ANSI_NULLS ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> CREATE TRIGGER [Rental_Statustrig]
> ON [dbo].[Rental_Info]
>
> Update Rental_Info
> Set Rental_Status => (select job_status
> from Master
> where Master.wwpjobnumber = Rental_Status.wwpjobnumber)
> where Rental_Info.wwpjobnumber IN
> (select wwpjobnumber
> from Master)
> END
> GO
> "Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
> news:uRgS3n9tGHA.3964@.TK2MSFTNGP04.phx.gbl...
>>I f I did a trigger would it allow me to change the value whenever I
>>wanted and allow me to keep the change?
>> "Roy Harvey" <roy_harvey@.snet.net> wrote in message
>> news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.4ax.com...
>> Two approaches. One is to write a subquery into the INSERT into the
>> Rental table. It might vaguely resemble something like:
>> INSERT Rental (jobnumber, B, RentalStatus)
>> SELECT 12345, B,
>> (select MasterStatus from Master
>> where master.jobnumber = '12345')
>> The other approach is an INSERT trigger on the Rental table, which
>> would include something like:
>> UPDATE Rental
>> SET RentalStatus =>> (select MasterStatus from Master
>> where master.jobnumber = Rental.jobnumber)
>> WHERE Rental.jobnumber IN
>> (select jobnumber from INSERTED)
>> Roy Harvey
>> Beacon Falls, CT
>> On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>It already holds the specific jobnumber in master but whenver a user
>>enters
>>that specific job into the rental table via infopath I want it to
>>automatically take on the status from the master table. But allow it to
>>be
>>changed in the rental table later. So basically just the first default
>>and
>>then after that i want to be able to change it manually and it leave it
>>like
>>that
>>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>>news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
>> >whenever it is imported to the Rental table
>> What do you mean by imported? What process is running?
>> One possible answer to your question, if my guess work happens to on
>> target:
>> INSERT Rental (A, B, C)
>> SELECT A, B, X
>> FROM Master
>> Roy
>> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for
>>the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have
>>any
>>suggestions for this. I dont even know where to start. Thanks
>>
>>
>|||I give up. Which thread are we working with here?
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ORxlP89tGHA.4852@.TK2MSFTNGP02.phx.gbl...
> Please do not make duplicate posts. You only waited one minute for a reply
> before you decided to start a new thread with the same question.
> The word END should not be included.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
> news:etGT709tGHA.2172@.TK2MSFTNGP05.phx.gbl...
>> What is wront with this trigger?
>> SET ANSI_NULLS ON
>> GO
>> SET QUOTED_IDENTIFIER ON
>> GO
>> CREATE TRIGGER [Rental_Statustrig]
>> ON [dbo].[Rental_Info]
>>
>> Update Rental_Info
>> Set Rental_Status =>> (select job_status
>> from Master
>> where Master.wwpjobnumber = Rental_Status.wwpjobnumber)
>> where Rental_Info.wwpjobnumber IN
>> (select wwpjobnumber
>> from Master)
>> END
>> GO
>> "Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
>> news:uRgS3n9tGHA.3964@.TK2MSFTNGP04.phx.gbl...
>>I f I did a trigger would it allow me to change the value whenever I
>>wanted and allow me to keep the change?
>> "Roy Harvey" <roy_harvey@.snet.net> wrote in message
>> news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.4ax.com...
>> Two approaches. One is to write a subquery into the INSERT into the
>> Rental table. It might vaguely resemble something like:
>> INSERT Rental (jobnumber, B, RentalStatus)
>> SELECT 12345, B,
>> (select MasterStatus from Master
>> where master.jobnumber = '12345')
>> The other approach is an INSERT trigger on the Rental table, which
>> would include something like:
>> UPDATE Rental
>> SET RentalStatus =>> (select MasterStatus from Master
>> where master.jobnumber = Rental.jobnumber)
>> WHERE Rental.jobnumber IN
>> (select jobnumber from INSERTED)
>> Roy Harvey
>> Beacon Falls, CT
>> On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>It already holds the specific jobnumber in master but whenver a user
>>enters
>>that specific job into the rental table via infopath I want it to
>>automatically take on the status from the master table. But allow it
>>to be
>>changed in the rental table later. So basically just the first default
>>and
>>then after that i want to be able to change it manually and it leave it
>>like
>>that
>>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>>news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
>> >whenever it is imported to the Rental table
>> What do you mean by imported? What process is running?
>> One possible answer to your question, if my guess work happens to on
>> target:
>> INSERT Rental (A, B, C)
>> SELECT A, B, X
>> FROM Master
>> Roy
>> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>>I have a table call Master and a table called Rental. They both have
>>>a
>>>status field that are named differently. What i want to happen is
>>>for the
>>>Status in the Rental table to default to whatever the status is in
>>>the
>>>Master table whenever it is imported to the Rental table. ANyone
>>>have any
>>>suggestions for this. I dont even know where to start. Thanks
>>>
>>
>>
>|||Thanks you all, I got it working using everyone of your expertise. Many
thanks.
Ben
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:74r6d251koh0rgerp3m6tt64rcm084mf2e@.4ax.com...
> If it is an INSERT trigger it will only execute when rows are
> inserted. It would have to be an UPDATE trigger to mess up your
> changes.
> Roy
> On Fri, 4 Aug 2006 10:24:12 -0500, "Ben Watts"
> <ben.watts@.aaronnickellhomes.com> wrote:
>>I f I did a trigger would it allow me to change the value whenever I
>>wanted
>>and allow me to keep the change?
>>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>>news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.4ax.com...
>> Two approaches. One is to write a subquery into the INSERT into the
>> Rental table. It might vaguely resemble something like:
>> INSERT Rental (jobnumber, B, RentalStatus)
>> SELECT 12345, B,
>> (select MasterStatus from Master
>> where master.jobnumber = '12345')
>> The other approach is an INSERT trigger on the Rental table, which
>> would include something like:
>> UPDATE Rental
>> SET RentalStatus =>> (select MasterStatus from Master
>> where master.jobnumber = Rental.jobnumber)
>> WHERE Rental.jobnumber IN
>> (select jobnumber from INSERTED)
>> Roy Harvey
>> Beacon Falls, CT
>> On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>It already holds the specific jobnumber in master but whenver a user
>>enters
>>that specific job into the rental table via infopath I want it to
>>automatically take on the status from the master table. But allow it to
>>be
>>changed in the rental table later. So basically just the first default
>>and
>>then after that i want to be able to change it manually and it leave it
>>like
>>that
>>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>>news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.4ax.com...
>> >whenever it is imported to the Rental table
>> What do you mean by imported? What process is running?
>> One possible answer to your question, if my guess work happens to on
>> target:
>> INSERT Rental (A, B, C)
>> SELECT A, B, X
>> FROM Master
>> Roy
>> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
>> <ben.watts@.aaronnickellhomes.com> wrote:
>>I have a table call Master and a table called Rental. They both have a
>>status field that are named differently. What i want to happen is for
>>the
>>Status in the Rental table to default to whatever the status is in the
>>Master table whenever it is imported to the Rental table. ANyone have
>>any
>>suggestions for this. I dont even know where to start. Thanks
>>

Default values

I have a table call Master and a table called Rental. They both have a
status field that are named differently. What i want to happen is for the
Status in the Rental table to default to whatever the status is in the
Master table whenever it is imported to the Rental table. ANyone have any
suggestions for this. I dont even know where to start. Thanks>whenever it is imported to the Rental table
What do you mean by imported? What process is running?
One possible answer to your question, if my guess work happens to on
target:
INSERT Rental (A, B, C)
SELECT A, B, X
FROM Master
Roy
On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
<ben.watts@.aaronnickellhomes.com> wrote:

>I have a table call Master and a table called Rental. They both have a
>status field that are named differently. What i want to happen is for the
>Status in the Rental table to default to whatever the status is in the
>Master table whenever it is imported to the Rental table. ANyone have any
>suggestions for this. I dont even know where to start. Thanks
>|||It already holds the specific jobnumber in master but whenver a user enters
that specific job into the rental table via infopath I want it to
automatically take on the status from the master table. But allow it to be
changed in the rental table later. So basically just the first default and
then after that i want to be able to change it manually and it leave it like
that
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.
4ax.com...[vbcol=seagreen]
> What do you mean by imported? What process is running?
> One possible answer to your question, if my guess work happens to on
> target:
> INSERT Rental (A, B, C)
> SELECT A, B, X
> FROM Master
> Roy
> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
> <ben.watts@.aaronnickellhomes.com> wrote:
>|||I pretty much need taken thru this all the way, like where do I insert that
code?
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.
4ax.com...[vbcol=seagreen]
> What do you mean by imported? What process is running?
> One possible answer to your question, if my guess work happens to on
> target:
> INSERT Rental (A, B, C)
> SELECT A, B, X
> FROM Master
> Roy
> On Fri, 4 Aug 2006 09:47:26 -0500, "Ben Watts"
> <ben.watts@.aaronnickellhomes.com> wrote:
>|||Two approaches. One is to write a subquery into the INSERT into the
Rental table. It might vaguely resemble something like:
INSERT Rental (jobnumber, B, RentalStatus)
SELECT 12345, B,
(select MasterStatus from Master
where master.jobnumber = '12345')
The other approach is an INSERT trigger on the Rental table, which
would include something like:
UPDATE Rental
SET RentalStatus =
(select MasterStatus from Master
where master.jobnumber = Rental.jobnumber)
WHERE Rental.jobnumber IN
(select jobnumber from INSERTED)
Roy Harvey
Beacon Falls, CT
On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
<ben.watts@.aaronnickellhomes.com> wrote:

>It already holds the specific jobnumber in master but whenver a user enters
>that specific job into the rental table via infopath I want it to
>automatically take on the status from the master table. But allow it to be
>changed in the rental table later. So basically just the first default and
>then after that i want to be able to change it manually and it leave it lik
e
>that
>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
> news:i1o6d2lk9en6v1rb7fju5ad1tidn3a4mvm@.
4ax.com...
>|||I f I did a trigger would it allow me to change the value whenever I wanted
and allow me to keep the change?
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.
4ax.com...[vbcol=seagreen]
> Two approaches. One is to write a subquery into the INSERT into the
> Rental table. It might vaguely resemble something like:
> INSERT Rental (jobnumber, B, RentalStatus)
> SELECT 12345, B,
> (select MasterStatus from Master
> where master.jobnumber = '12345')
> The other approach is an INSERT trigger on the Rental table, which
> would include something like:
> UPDATE Rental
> SET RentalStatus =
> (select MasterStatus from Master
> where master.jobnumber = Rental.jobnumber)
> WHERE Rental.jobnumber IN
> (select jobnumber from INSERTED)
> Roy Harvey
> Beacon Falls, CT
> On Fri, 4 Aug 2006 10:07:43 -0500, "Ben Watts"
> <ben.watts@.aaronnickellhomes.com> wrote:
>|||What is wront with this trigger?
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [Rental_Statustrig]
ON [dbo].[Rental_Info]
Update Rental_Info
Set Rental_Status =
(select job_status
from Master
where Master.wwpjobnumber = Rental_Status.wwpjobnumber)
where Rental_Info.wwpjobnumber IN
(select wwpjobnumber
from Master)
END
GO
"Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
news:uRgS3n9tGHA.3964@.TK2MSFTNGP04.phx.gbl...
>I f I did a trigger would it allow me to change the value whenever I wanted
>and allow me to keep the change?
> "Roy Harvey" <roy_harvey@.snet.net> wrote in message
> news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.
4ax.com...
>|||If it is an INSERT trigger it will only execute when rows are
inserted. It would have to be an UPDATE trigger to mess up your
changes.
Roy
On Fri, 4 Aug 2006 10:24:12 -0500, "Ben Watts"
<ben.watts@.aaronnickellhomes.com> wrote:

>I f I did a trigger would it allow me to change the value whenever I wanted
>and allow me to keep the change?
>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
> news:cso6d250qdsr3crt82hpgut3a0h42obvo4@.
4ax.com...
>|||Please do not make duplicate posts. You only waited one minute for a reply
before you decided to start a new thread with the same question.
The word END should not be included.
HTH
Kalen Delaney, SQL Server MVP
"Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
news:etGT709tGHA.2172@.TK2MSFTNGP05.phx.gbl...
> What is wront with this trigger?
> SET ANSI_NULLS ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> CREATE TRIGGER [Rental_Statustrig]
> ON [dbo].[Rental_Info]
>
> Update Rental_Info
> Set Rental_Status =
> (select job_status
> from Master
> where Master.wwpjobnumber = Rental_Status.wwpjobnumber)
> where Rental_Info.wwpjobnumber IN
> (select wwpjobnumber
> from Master)
> END
> GO
> "Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
> news:uRgS3n9tGHA.3964@.TK2MSFTNGP04.phx.gbl...
>|||I give up. Which thread are we working with here?
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:ORxlP89tGHA.4852@.TK2MSFTNGP02.phx.gbl...
> Please do not make duplicate posts. You only waited one minute for a reply
> before you decided to start a new thread with the same question.
> The word END should not be included.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
> news:etGT709tGHA.2172@.TK2MSFTNGP05.phx.gbl...
>

Sunday, February 19, 2012

Default value for a feild

I would like have the default value for a feild to be the result of a call to

System.Web.Security.

Membership.GeneratePassword(12,4)

How do I implement this?

In a trigger? Do you have sample code?

Thank you very much

Hi,

I think I know what you are asking, and my guess is thatyou may be trying to combine two parts of a solution into one. The default value for a column is a value set for every row in a table, until it is changed by entering another value. So that default value is stored in the database for each row, just as every other column value in the BD. The only difference is that a deafult value is inserted into place in that column row intersection when ever a new row is being entered. The rest of the column values for that row are entered at the time of the creation of that new row. when all the column values have been entered and there are no valiadtion problems, that new row is added to the DB as a transaction (so the complete row is entered - or not entered, as unit).

What your question seems to suggest, is that some value be dynamically selected or calculated, and that value entered into a row of data as a new row is being filled out for entry. That wouldn't be a default value in a DB, but could be a default value in the application that you use to access the DB to enter new data rows in the DB. Do you see the distinction? Onethe DB default value is there whenever and however a new row is added to the DB. The application default value is placed in position to be entered as a column value in a new row for the DB,by the application;as this is an ASP.Net forum, probably by an ASP.Net web app.

If what you want is that a column value in the database (that has just been entered via some application that is used to enter new rows into the DB), be changed (in the DB), whenever a new row of data is entered - and have that value drawn from a call or other source dynamically; then a trigger would be one way to do it. A trigger always works as the result of some specific action (such as the entry of a new row of data). Another way to do it would be to do the call as part of the application - rather than by the DBMS. You can write the app any way you want. You can have it show the value to the user doing the entry, or hide it, or even change whatever they enter to the dynamic value after they enter data, but before the DB is updated with the new row.

The most important thing is that you have clear in your mind what data you want stored in the DB, and which parts of the data entry process you want done in an application outside the DB, and what you want the database management system to take care of. Because data integrity is so important to most databases, there may be DB schema restrictions for data entry/removal/updates. Be very careful about selecting methodes that would circumvent those safegards. BRN..

|||

Please help with the following scenario:

A gridview has its datasource bound to an object datasource made of a list of blank data entities such as date, name, amount, etc... The user goes in the grid and enter data in each cell which is a texbox. Now, right after the first row is filled, how can data of that row be put in the next row and display as default data as the cursor moves into it? (All data entered will be submitted by a click of a button at the bottom of the page.) Thanks.