dbTalk Databases Forums  

Re: How to capture record when error occured

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Re: How to capture record when error occured in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How to capture record when error occured - 08-07-2004 , 03:03 AM






Why deliberately fail?

Have two procs. Filter on

WHERE col IS NOT NULL (to your proper table)

and then you can use

WHERE Col IS NULL and log those rows somewhere else.

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"ramck9" <ramck9 (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi

My table contains non null fields and i am trying to insert null values in
to the table. i have added the error handling code. so when error occures
it
goes to error handling and write to a table that error occured on
insertion.
I want to capture the current record. how can i do that?

what i am trying to do is ...

i wrote a stored procedure to pull data from source system to target
system.


BEGIN
INSERT INTO sample
(Key,Name,Type)
SELECT Key,Name,Type
FROM sample2
SELECT @intError = @@Error
IF @intError <> 0
--error
--write to error table
END

i want to capture the Key, name, and Type form the sample2 and put that in
to error table on exception. pl help me i need this v urgent.

-Ram




Reply With Quote
  #2  
Old   
ramck9
 
Posts: n/a

Default Re: How to capture record when error occured - 08-09-2004 , 08:35 AM






Thanks Allen, this is one way of capturing the nulls, but generally how we
handle errors? if some thing other than NULL exeption occures? shall i write
a procedure for that too...


"Allan Mitchell" wrote:

Quote:
Why deliberately fail?

Have two procs. Filter on

WHERE col IS NOT NULL (to your proper table)

and then you can use

WHERE Col IS NULL and log those rows somewhere else.

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"ramck9" <ramck9 (AT) discussions (DOT) microsoft.com> wrote in message
news:A5F0CC54-3BE0-4B16-9803-8C776C1DA74D (AT) microsoft (DOT) com...
Hi

My table contains non null fields and i am trying to insert null values in
to the table. i have added the error handling code. so when error occures
it
goes to error handling and write to a table that error occured on
insertion.
I want to capture the current record. how can i do that?

what i am trying to do is ...

i wrote a stored procedure to pull data from source system to target
system.


BEGIN
INSERT INTO sample
(Key,Name,Type)
SELECT Key,Name,Type
FROM sample2
SELECT @intError = @@Error
IF @intError <> 0
--error
--write to error table
END

i want to capture the Key, name, and Type form the sample2 and put that in
to error table on exception. pl help me i need this v urgent.

-Ram





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.