Showing posts with label exist. Show all posts
Showing posts with label exist. Show all posts

Friday, March 30, 2012

Raise an error in the dataflow

HI, I have a lookup that find a specific row. If that row does not exist, I need to create a new one. If it exists, I need to raise an error and trap it with the "on_error" event of the dataflow in order to log it. Is there a way to raise an error and specify the error message from the dataflow? I was thinking using the conditional split and verify if the value returned from the lookup (by set the error config to ignore the error) is not or not. But how can I raise an error when the value is not null?

Thank you,

Ccote

You'll need a script component in order to do this.

The syntax is:

ComponentMetadata.FireError(...)

-Jamie

Tuesday, March 20, 2012

Quickest query to know if a record exist or not

I have a lookup table like:
ID Desc
-- --
1 AAa
2 B
3 C
I know there are some queries to to see if an ID exist in this table or not
,but I just wondered which one is the quickest one.
ThanksSomething like this:
IF EXISTS (SELECT * FROM T_CorpData WHERE CorpID = 'acn1')
PRINT 'Row Exists'
Keith
"RayAll" <RayAll@.microsft.com> wrote in message
news:esE9X2BIFHA.1288@.TK2MSFTNGP10.phx.gbl...
> I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or
not
> ,but I just wondered which one is the quickest one.
> Thanks
>|||Try,
declare @.id ...
if exists(select * from t where [ID] = @.id)
print 'yes'
else
print 'no'
go
AMB
"RayAll" wrote:

> I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or no
t
> ,but I just wondered which one is the quickest one.
> Thanks
>
>|||Hi
This may depend on what the context is that you require to know the
existance, but try:
IF EXISTS ( SELECT 1 FROM [Lookup Table] where Id = 1)
...
Please post DDL as http://www.aspfaq.com/etiquette.asp?id=5006 and
example data as insert statements http://vyaskn.tripod.com/code.htm#inserts
John
"RayAll" wrote:

> I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or no
t
> ,but I just wondered which one is the quickest one.
> Thanks
>
>|||IF EXISTS (SELECT * FROM YourTable WHERE ID = xx)
Print 'It exists'
Andrew J. Kelly SQL MVP
"RayAll" <RayAll@.microsft.com> wrote in message
news:esE9X2BIFHA.1288@.TK2MSFTNGP10.phx.gbl...
>I have a lookup table like:
> ID Desc
> -- --
> 1 AAa
> 2 B
> 3 C
> I know there are some queries to to see if an ID exist in this table or
> not ,but I just wondered which one is the quickest one.
> Thanks
>

Friday, March 9, 2012

Quick question on Cascade Delete

Is cascade delete and cascade update new to 2000 or did it exist in 7?
Thank you,
MikeNew for 2000
"Mike Hildner" <mhildner@.afweb.com> wrote in message
news:ORKfTeV$DHA.3804@.TK2MSFTNGP09.phx.gbl...
> Is cascade delete and cascade update new to 2000 or did it exist in 7?
> Thank you,
> Mike
>|||Thank you.
"Scott Morris" <bogus@.bogus.com> wrote in message
news:%23Jc8kqV$DHA.712@.tk2msftngp13.phx.gbl...
> New for 2000
> "Mike Hildner" <mhildner@.afweb.com> wrote in message
> news:ORKfTeV$DHA.3804@.TK2MSFTNGP09.phx.gbl...
>

Quick question on Cascade Delete

Is cascade delete and cascade update new to 2000 or did it exist in 7?
Thank you,
MikeNew for 2000
"Mike Hildner" <mhildner@.afweb.com> wrote in message
news:ORKfTeV$DHA.3804@.TK2MSFTNGP09.phx.gbl...
> Is cascade delete and cascade update new to 2000 or did it exist in 7?
> Thank you,
> Mike
>|||Thank you.
"Scott Morris" <bogus@.bogus.com> wrote in message
news:%23Jc8kqV$DHA.712@.tk2msftngp13.phx.gbl...
> New for 2000
> "Mike Hildner" <mhildner@.afweb.com> wrote in message
> news:ORKfTeV$DHA.3804@.TK2MSFTNGP09.phx.gbl...
> > Is cascade delete and cascade update new to 2000 or did it exist in 7?
> >
> > Thank you,
> > Mike
> >
> >
>