Showing posts with label duplicate. Show all posts
Showing posts with label duplicate. Show all posts

Wednesday, March 21, 2012

Referential Integrity constraints

Dear Sir,
Yesterday during an Interview...i have faced some problem. I would like to
clearify that NN (NOT NULL), ND (NOT DUPLICATE) AND NC(NOT CHANGE)
constraints work ...when we define a Primary Key on any Table column. If,
Yes( as i hope) then how and what's the meaning of this NC. Can You Plz. giv
e
me briefly explain and can we use this in ORACLE .> ...me briefly explain and can we use this in ORACLE .
This is a SQL Server forum. You probably get (better) help in an Oracle foru
m.
In SQL Server, defining a PK doesn't prohibit you to change the value of the
PK column for one or
several rows.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Sanjeev Kumar Sinha" <Sanjeev Kumar Sinha@.discussions.microsoft.com> wrote
in message
news:E7240299-73E3-4C56-891D-66F4CB533174@.microsoft.com...
> Dear Sir,
> Yesterday during an Interview...i have faced some problem. I would like to
> clearify that NN (NOT NULL), ND (NOT DUPLICATE) AND NC(NOT CHANGE)
> constraints work ...when we define a Primary Key on any Table column. If,
> Yes( as i hope) then how and what's the meaning of this NC. Can You Plz. g
ive
> me briefly explain and can we use this in ORACLE .
>
>|||Yeah, well now I would like it to :)
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Blog - http://spaces.msn.com/members/drsql/
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OHOkklxHFHA.156@.TK2MSFTNGP10.phx.gbl...
> This is a SQL Server forum. You probably get (better) help in an Oracle
> forum.
> In SQL Server, defining a PK doesn't prohibit you to change the value of
> the PK column for one or several rows.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Sanjeev Kumar Sinha" <Sanjeev Kumar Sinha@.discussions.microsoft.com>
> wrote in message
> news:E7240299-73E3-4C56-891D-66F4CB533174@.microsoft.com...
>|||You have to talk to the ANSI SQL committee about that, Louis. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Louis Davidson" <dr_dontspamme_sql@.hotmail.com> wrote in message
news:OCdomJ1HFHA.3076@.tk2msftngp13.phx.gbl...
> Yeah, well now I would like it to :)
> --
> ----
--
> Louis Davidson - drsql@.hotmail.com
> SQL Server MVP
> Compass Technology Management - www.compass.net
> Pro SQL Server 2000 Database Design - http://www.apress.com/book/bookDisp...r />
l?bID=266
> Blog - http://spaces.msn.com/members/drsql/
> Note: Please reply to the newsgroups only unless you are interested in con
sulting services. All
> other replies may be ignored :)
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:OHOkklxHFHA.156@.TK2MSFTNGP10.phx.gbl...

Wednesday, March 7, 2012

Re-Execution of For each Loop Container

I have a For each loop container and inside the same a group of text files are loading to a table using bulk insert task.If there are duplicate files i dont wish to load it into the table. Duplicate check can be done by script task but how do i skip the files and repeat the for loop for the next files.

That means i want to skip some files and load the other files in a for loop.
How do i do that.

Can anybody please help me.

So here is what you do

Loop container has inside a Script task that checks for a duplicate file

and a BULK INSERT task that does what it says on the tin.

The script task and the BI task are joined by workflow.

Declare a variable say something like FileAlreadyThere of type DT_BOOL

(boolean)

In the script task if the file is already there set the value of this

variable to TRUE and if not then FALSE.

The workflow now between the two tasks should be based on an expression

as well as outcome so have a look at this article and you want to set

your expression to something like

@.FileAlreadyThere == FALSE

http://wiki.sqlis.com/default.aspx/SQLISWiki/LogicalOrExample.html

Allan

"Raj Amb@.discussions.microsoft.com"

wrote in message

news:1b962d72-8a6d-4b3c-bdab-e86bfda3270b@.discussions.microsoft.com:

> I have a For each loop container and inside the same a group of text

> files are loading to a table using bulk insert task.If there are

> duplicate files i dont wish to load it into the table. Duplicate check

> can be done by script task but how do i skip the files and repeat the

> for loop for the next files.

>

> That means i want to skip some files and load the other files in a for

> loop.

> How do i do that.

>

> Can anybody please help me.|||Thank you very much for your post. I would like to know one more thing that in the same for loop if the bulk load of one file fails the whole package(For loop) fails.

but i want to continue/iterate the for loop till the last file , how do i do that.|||

Raj Amb wrote:

Thank you very much for your post. I would like to know one more thing that in the same for loop if the bulk load of one file fails the whole package(For loop) fails.

but i want to continue/iterate the for loop till the last file , how do i do that.


This is controlled by two properties:
1) FailPackageOnFailure on each task or container - set it to false to ignore errors.
2) Also, each task and container have MaxErrorCount - increase it to desired value.