![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
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 |
#2
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |