Showing posts with label constraint. Show all posts
Showing posts with label constraint. Show all posts

Monday, February 27, 2012

how can I get the row number(error row) while constraint failure at the OLE DB destination?

my project is insert data to OLE DB destination from csv file.

my question is

how can I get the row number(error row) while constraint failure at the OLE DB destination?

thanks.

You can't. There is no concept of row numbers in the SSIS pipeline (for good reasons).

What you CAN do is divert the erroring rows elsewhere for examination later.

-Jamie

|||

thank you.

it saves me a lot of time.

|||What good reasons ?

how can I get the row number(error row) while constraint failure at the OLE DB destination?

my project is insert data to OLE DB destination from csv file.

my question is

how can I get the row number(error row) while constraint failure at the OLE DB destination?

thanks.

You can't. There is no concept of row numbers in the SSIS pipeline (for good reasons).

What you CAN do is divert the erroring rows elsewhere for examination later.

-Jamie

|||

thank you.

it saves me a lot of time.

|||What good reasons ?

Friday, February 24, 2012

How can I get or set a foreign key's 'on update cascade' or 'on insert cascade' by SQLDMO?

Hello,everyone!
I have a problem with sqldmo's KEY object,please help me!
When creating a foreign key constraint with 'on update cascade ' or 'on delete no action ' by T-SQL,we can do like this:
ALTER TABLE [dbo].[myForeignTableName] with nocheck
ADD CONSTRAINT [FK_mykeyname] FOREIGN KEY
([myForeignColumn])
REFERENCES [dbo].[myPrimaryTableName]
([myPrimaryKeyColumn])
on delete no action on update cascade

But,how can I set or get ' on delete no action on update cascade ' by SQLDMO's KEY object?

Thank you very much!
Toly.

DMO does not support cascaded delete. SMO however, does support it.|||

A thousand thanks for Michiel Wories's help! Your answer is very very heplful to me!

Koly.