I have transactional Replication from A to B.
My distribution agent failed becos of a primary key violation error in a table.[i have not included the skip error option].
Then the replication stopped.
The transactions on other tables are also not replicated to B.
IF an error is encountered in one of the tables will the replication stop entirely??.Is there no way for the replication to continue for the rest of the tables..
Pls clarifyI don't think you can skip this error. To use Replication you have to have a primary key in the table you want to replicate.|||The transactions are processed in a serialized fashion, meaning that if one failed nothing else goes through.
Showing posts with label violation. Show all posts
Showing posts with label violation. Show all posts
Sunday, March 11, 2012
Error in Replication how to continue
Wednesday, February 15, 2012
error handling using JDBC DRIVER
Hi All,
I ammaking use of the microsoft JDBC driver.
In the SP, in a transaction when a error is encountered --> fatal error (PK violation / incompatible data types) then the control returns to the application abruptly.
the error handling within the SP is not carried out.
Any help on the same is appreciated.
Thanks
Anu
| Thread-Topic: error handling using JDBC DRIVER
| thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
| X-WBNR-Posting-Host: 203.200.17.10
| From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
| Subject: error handling using JDBC DRIVER
| Date: Thu, 29 Jul 2004 03:58:00 -0700
| Lines: 15
| Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi All,
|
| I ammaking use of the microsoft JDBC driver.
|
| In the SP, in a transaction when a error is encountered --> fatal error
(PK violation / incompatible data types) then the control returns to the
application abruptly.
|
| the error handling within the SP is not carried out.
|
| Any help on the same is appreciated.
|
| Thanks
| Anu
|
|
|
|
Hello,
Can you provide sample code that demonstrates this problem?
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
|||Hi @.ll
i have the same-problem
sample code:
SP USER_REGISTER
@.username char(25),@.usershowname char(25), @.useremail
char(100),@.userpasswort varchar(10)
AS
declare @.message varchar(300), @.errno bigint
set @.message='Registrierung wird durchgeführt'
insert into game_user(user_name,user_showname,user_email,user_ passwort)
values(ltrim(rtrim(@.username)),ltrim(rtrim(@.usersh owname)),ltrim(rtrim(@.useremail)),ltrim(rtrim(@.use rpasswort)))
set @.errno = @.@.error
print @.errno
IF @.errno <> 0
BEGIN
if @.errno = 2627
begin
set @.message='Username oder Email-Adresse bereits registriert'
end
END
ELSE
BEGIN
set @.message ='User wurde registriert'
END
select @.message as RESULT
end SP
The application get the errorcode 2627 ....
"Carb Simien [MSFT]" wrote:
> --
> | Thread-Topic: error handling using JDBC DRIVER
> | thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
> | X-WBNR-Posting-Host: 203.200.17.10
> | From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
> | Subject: error handling using JDBC DRIVER
> | Date: Thu, 29 Jul 2004 03:58:00 -0700
> | Lines: 15
> | Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.jdbcdriver
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
> | X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
> |
> | Hi All,
> |
> | I ammaking use of the microsoft JDBC driver.
> |
> | In the SP, in a transaction when a error is encountered --> fatal error
> (PK violation / incompatible data types) then the control returns to the
> application abruptly.
> |
> | the error handling within the SP is not carried out.
> |
> | Any help on the same is appreciated.
> |
> | Thanks
> | Anu
> |
> |
> |
> |
> Hello,
> Can you provide sample code that demonstrates this problem?
> Carb Simien, MCSE MCDBA MCAD
> Microsoft Developer Support - Web Data
> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Are you secure? For information about the Strategic Technology Protection
> Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.com/security.
>
|||| Thread-Topic: error handling using JDBC DRIVER
| thread-index: AcSfHIJuOFthVFyySJS0yWEV7H5QYg==
| X-WBNR-Posting-Host: 81.223.39.26
| From: "=?Utf-8?B?T25saW5ldGFsay5uZXQ=?="
<Onlinetalk.net@.discussions.microsoft.com>
| References: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
<nu7#Z1XeEHA.2036@.cpmsftngxa10.phx.gbl>
| Subject: RE: error handling using JDBC DRIVER
| Date: Mon, 20 Sep 2004 07:17:06 -0700
| Lines: 102
| Message-ID: <8E77A45A-DDAB-45E2-BC12-29697F00471D@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.jdbcdriver:6281
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi @.ll
|
| i have the same-problem
|
| sample code:
|
| SP USER_REGISTER
| @.username char(25),@.usershowname char(25), @.useremail
| char(100),@.userpasswort varchar(10)
| AS
| declare @.message varchar(300), @.errno bigint
|
| set @.message='Registrierung wird durchgeführt'
|
| insert into game_user(user_name,user_showname,user_email,user_ passwort)
values(ltrim(rtrim(@.username)),ltrim(rtrim(@.usersh owname)),ltrim(rtrim(@.user
email)),ltrim(rtrim(@.userpasswort)))
|
| set @.errno = @.@.error
|
| print @.errno
|
| IF @.errno <> 0
| BEGIN
| if @.errno = 2627
| begin
| set @.message='Username oder Email-Adresse bereits registriert'
| end
| END
| ELSE
| BEGIN
|
| set @.message ='User wurde registriert'
| END
|
| select @.message as RESULT
|
| end SP
|
| The application get the errorcode 2627 ....
|
|
| "Carb Simien [MSFT]" wrote:
|
| >
| > --
| > | Thread-Topic: error handling using JDBC DRIVER
| > | thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
| > | X-WBNR-Posting-Host: 203.200.17.10
| > | From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
| > | Subject: error handling using JDBC DRIVER
| > | Date: Thu, 29 Jul 2004 03:58:00 -0700
| > | Lines: 15
| > | Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.jdbcdriver
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| > | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
| > | X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
| > |
| > | Hi All,
| > |
| > | I ammaking use of the microsoft JDBC driver.
| > |
| > | In the SP, in a transaction when a error is encountered --> fatal
error
| > (PK violation / incompatible data types) then the control returns to
the
| > application abruptly.
| > |
| > | the error handling within the SP is not carried out.
| > |
| > | Any help on the same is appreciated.
| > |
| > | Thanks
| > | Anu
| > |
| > |
| > |
| > |
| >
| > Hello,
| >
| > Can you provide sample code that demonstrates this problem?
| >
| > Carb Simien, MCSE MCDBA MCAD
| > Microsoft Developer Support - Web Data
| >
| > Please reply only to the newsgroups.
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| > Are you secure? For information about the Strategic Technology
Protection
| > Program and to order your FREE Security Tool Kit, please visit
| > http://www.microsoft.com/security.
| >
| >
|
If you are using Query Analyzer to execute the stored procedure, then you
will see the remainder of the stored procedure being processed. However,
this is not the case with both JDBC and ODBCTest (direct ODBC API calls).
As a test, I took the stored procedure from this post and added an INSERT
statement immediately after "set @.message='Username oder Email-Adresse
bereits registriert'". What I found is that even though the subsequent
code in the procedure was not shown in the JDBC and ODBCTest code, the
INSERT did, in fact, fire. I don't think you will get the other results
back to the client because the statement has been terminated by that point.
However, the INSERT results can be seen if you check the table after the
fact.
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
I ammaking use of the microsoft JDBC driver.
In the SP, in a transaction when a error is encountered --> fatal error (PK violation / incompatible data types) then the control returns to the application abruptly.
the error handling within the SP is not carried out.
Any help on the same is appreciated.
Thanks
Anu
| Thread-Topic: error handling using JDBC DRIVER
| thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
| X-WBNR-Posting-Host: 203.200.17.10
| From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
| Subject: error handling using JDBC DRIVER
| Date: Thu, 29 Jul 2004 03:58:00 -0700
| Lines: 15
| Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi All,
|
| I ammaking use of the microsoft JDBC driver.
|
| In the SP, in a transaction when a error is encountered --> fatal error
(PK violation / incompatible data types) then the control returns to the
application abruptly.
|
| the error handling within the SP is not carried out.
|
| Any help on the same is appreciated.
|
| Thanks
| Anu
|
|
|
|
Hello,
Can you provide sample code that demonstrates this problem?
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
|||Hi @.ll
i have the same-problem
sample code:
SP USER_REGISTER
@.username char(25),@.usershowname char(25), @.useremail
char(100),@.userpasswort varchar(10)
AS
declare @.message varchar(300), @.errno bigint
set @.message='Registrierung wird durchgeführt'
insert into game_user(user_name,user_showname,user_email,user_ passwort)
values(ltrim(rtrim(@.username)),ltrim(rtrim(@.usersh owname)),ltrim(rtrim(@.useremail)),ltrim(rtrim(@.use rpasswort)))
set @.errno = @.@.error
print @.errno
IF @.errno <> 0
BEGIN
if @.errno = 2627
begin
set @.message='Username oder Email-Adresse bereits registriert'
end
END
ELSE
BEGIN
set @.message ='User wurde registriert'
END
select @.message as RESULT
end SP
The application get the errorcode 2627 ....
"Carb Simien [MSFT]" wrote:
> --
> | Thread-Topic: error handling using JDBC DRIVER
> | thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
> | X-WBNR-Posting-Host: 203.200.17.10
> | From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
> | Subject: error handling using JDBC DRIVER
> | Date: Thu, 29 Jul 2004 03:58:00 -0700
> | Lines: 15
> | Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.jdbcdriver
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
> | X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
> |
> | Hi All,
> |
> | I ammaking use of the microsoft JDBC driver.
> |
> | In the SP, in a transaction when a error is encountered --> fatal error
> (PK violation / incompatible data types) then the control returns to the
> application abruptly.
> |
> | the error handling within the SP is not carried out.
> |
> | Any help on the same is appreciated.
> |
> | Thanks
> | Anu
> |
> |
> |
> |
> Hello,
> Can you provide sample code that demonstrates this problem?
> Carb Simien, MCSE MCDBA MCAD
> Microsoft Developer Support - Web Data
> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Are you secure? For information about the Strategic Technology Protection
> Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.com/security.
>
|||| Thread-Topic: error handling using JDBC DRIVER
| thread-index: AcSfHIJuOFthVFyySJS0yWEV7H5QYg==
| X-WBNR-Posting-Host: 81.223.39.26
| From: "=?Utf-8?B?T25saW5ldGFsay5uZXQ=?="
<Onlinetalk.net@.discussions.microsoft.com>
| References: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
<nu7#Z1XeEHA.2036@.cpmsftngxa10.phx.gbl>
| Subject: RE: error handling using JDBC DRIVER
| Date: Mon, 20 Sep 2004 07:17:06 -0700
| Lines: 102
| Message-ID: <8E77A45A-DDAB-45E2-BC12-29697F00471D@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.jdbcdriver:6281
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi @.ll
|
| i have the same-problem
|
| sample code:
|
| SP USER_REGISTER
| @.username char(25),@.usershowname char(25), @.useremail
| char(100),@.userpasswort varchar(10)
| AS
| declare @.message varchar(300), @.errno bigint
|
| set @.message='Registrierung wird durchgeführt'
|
| insert into game_user(user_name,user_showname,user_email,user_ passwort)
values(ltrim(rtrim(@.username)),ltrim(rtrim(@.usersh owname)),ltrim(rtrim(@.user
email)),ltrim(rtrim(@.userpasswort)))
|
| set @.errno = @.@.error
|
| print @.errno
|
| IF @.errno <> 0
| BEGIN
| if @.errno = 2627
| begin
| set @.message='Username oder Email-Adresse bereits registriert'
| end
| END
| ELSE
| BEGIN
|
| set @.message ='User wurde registriert'
| END
|
| select @.message as RESULT
|
| end SP
|
| The application get the errorcode 2627 ....
|
|
| "Carb Simien [MSFT]" wrote:
|
| >
| > --
| > | Thread-Topic: error handling using JDBC DRIVER
| > | thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
| > | X-WBNR-Posting-Host: 203.200.17.10
| > | From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
| > | Subject: error handling using JDBC DRIVER
| > | Date: Thu, 29 Jul 2004 03:58:00 -0700
| > | Lines: 15
| > | Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.jdbcdriver
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| > | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
| > | X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
| > |
| > | Hi All,
| > |
| > | I ammaking use of the microsoft JDBC driver.
| > |
| > | In the SP, in a transaction when a error is encountered --> fatal
error
| > (PK violation / incompatible data types) then the control returns to
the
| > application abruptly.
| > |
| > | the error handling within the SP is not carried out.
| > |
| > | Any help on the same is appreciated.
| > |
| > | Thanks
| > | Anu
| > |
| > |
| > |
| > |
| >
| > Hello,
| >
| > Can you provide sample code that demonstrates this problem?
| >
| > Carb Simien, MCSE MCDBA MCAD
| > Microsoft Developer Support - Web Data
| >
| > Please reply only to the newsgroups.
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| > Are you secure? For information about the Strategic Technology
Protection
| > Program and to order your FREE Security Tool Kit, please visit
| > http://www.microsoft.com/security.
| >
| >
|
If you are using Query Analyzer to execute the stored procedure, then you
will see the remainder of the stored procedure being processed. However,
this is not the case with both JDBC and ODBCTest (direct ODBC API calls).
As a test, I took the stored procedure from this post and added an INSERT
statement immediately after "set @.message='Username oder Email-Adresse
bereits registriert'". What I found is that even though the subsequent
code in the procedure was not shown in the JDBC and ODBCTest code, the
INSERT did, in fact, fire. I don't think you will get the other results
back to the client because the statement has been terminated by that point.
However, the INSERT results can be seen if you check the table after the
fact.
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Error Handling in SQL?
Hi there,
A insert query fails because of the erroneous data (primary key violation,
data type mismatch, etc). This insert statement is in the middle of a stored
procedure, which is part of a large system. We don't have the error handling
code in the system. Whenver error happens, it simply exits.
The big problem is that for such case, one bad record in the insert query
can take down the entire system.
It will be ideal if this query can automatically re-run when it failed in
the first run and filter out the "problem" records and succeed in the second
attempt without taking down the entire system.
Any idea, sample code or suggestion are highly appreciated.
LX
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
will get you started.
Jacco Schalkwijk
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
> stored
> procedure, which is part of a large system. We don't have the error
> handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
> second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>
A insert query fails because of the erroneous data (primary key violation,
data type mismatch, etc). This insert statement is in the middle of a stored
procedure, which is part of a large system. We don't have the error handling
code in the system. Whenver error happens, it simply exits.
The big problem is that for such case, one bad record in the insert query
can take down the entire system.
It will be ideal if this query can automatically re-run when it failed in
the first run and filter out the "problem" records and succeed in the second
attempt without taking down the entire system.
Any idea, sample code or suggestion are highly appreciated.
LX
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
will get you started.
Jacco Schalkwijk
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
> stored
> procedure, which is part of a large system. We don't have the error
> handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
> second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>
Error Handling in SQL?
Hi there,
A insert query fails because of the erroneous data (primary key violation,
data type mismatch, etc). This insert statement is in the middle of a stored
procedure, which is part of a large system. We don't have the error handling
code in the system. Whenver error happens, it simply exits.
The big problem is that for such case, one bad record in the insert query
can take down the entire system.
It will be ideal if this query can automatically re-run when it failed in
the first run and filter out the "problem" records and succeed in the second
attempt without taking down the entire system.
Any idea, sample code or suggestion are highly appreciated.
LXhttp://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
will get you started.
Jacco Schalkwijk
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
> stored
> procedure, which is part of a large system. We don't have the error
> handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
> second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>|||data type mis-match will abort processing, primary key errors won't. Jacco's
already pointed you out to the best articles available on tsql error
handling but I'd add that you really need to handle error conditions in your
client application if you want re-try logic. It's the only place where
that's even possible if TSQL aborts processing..
HTH
Regards,
Greg Linwood
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
stored
> procedure, which is part of a large system. We don't have the error
handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>
A insert query fails because of the erroneous data (primary key violation,
data type mismatch, etc). This insert statement is in the middle of a stored
procedure, which is part of a large system. We don't have the error handling
code in the system. Whenver error happens, it simply exits.
The big problem is that for such case, one bad record in the insert query
can take down the entire system.
It will be ideal if this query can automatically re-run when it failed in
the first run and filter out the "problem" records and succeed in the second
attempt without taking down the entire system.
Any idea, sample code or suggestion are highly appreciated.
LXhttp://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
will get you started.
Jacco Schalkwijk
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
> stored
> procedure, which is part of a large system. We don't have the error
> handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
> second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>|||data type mis-match will abort processing, primary key errors won't. Jacco's
already pointed you out to the best articles available on tsql error
handling but I'd add that you really need to handle error conditions in your
client application if you want re-try logic. It's the only place where
that's even possible if TSQL aborts processing..
HTH
Regards,
Greg Linwood
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
stored
> procedure, which is part of a large system. We don't have the error
handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>
Error Handling in SQL?
Hi there,
A insert query fails because of the erroneous data (primary key violation,
data type mismatch, etc). This insert statement is in the middle of a stored
procedure, which is part of a large system. We don't have the error handling
code in the system. Whenver error happens, it simply exits.
The big problem is that for such case, one bad record in the insert query
can take down the entire system.
It will be ideal if this query can automatically re-run when it failed in
the first run and filter out the "problem" records and succeed in the second
attempt without taking down the entire system.
Any idea, sample code or suggestion are highly appreciated.
LXhttp://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
will get you started.
--
Jacco Schalkwijk
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
> stored
> procedure, which is part of a large system. We don't have the error
> handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
> second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>|||data type mis-match will abort processing, primary key errors won't. Jacco's
already pointed you out to the best articles available on tsql error
handling but I'd add that you really need to handle error conditions in your
client application if you want re-try logic. It's the only place where
that's even possible if TSQL aborts processing..
HTH
Regards,
Greg Linwood
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
stored
> procedure, which is part of a large system. We don't have the error
handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>
A insert query fails because of the erroneous data (primary key violation,
data type mismatch, etc). This insert statement is in the middle of a stored
procedure, which is part of a large system. We don't have the error handling
code in the system. Whenver error happens, it simply exits.
The big problem is that for such case, one bad record in the insert query
can take down the entire system.
It will be ideal if this query can automatically re-run when it failed in
the first run and filter out the "problem" records and succeed in the second
attempt without taking down the entire system.
Any idea, sample code or suggestion are highly appreciated.
LXhttp://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
will get you started.
--
Jacco Schalkwijk
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
> stored
> procedure, which is part of a large system. We don't have the error
> handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
> second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>|||data type mis-match will abort processing, primary key errors won't. Jacco's
already pointed you out to the best articles available on tsql error
handling but I'd add that you really need to handle error conditions in your
client application if you want re-try logic. It's the only place where
that's even possible if TSQL aborts processing..
HTH
Regards,
Greg Linwood
SQL Server MVP
"FLX" <nospam@.hotmail.com> wrote in message
news:%23qlKbtXeEHA.724@.TK2MSFTNGP10.phx.gbl...
> Hi there,
> A insert query fails because of the erroneous data (primary key violation,
> data type mismatch, etc). This insert statement is in the middle of a
stored
> procedure, which is part of a large system. We don't have the error
handling
> code in the system. Whenver error happens, it simply exits.
> The big problem is that for such case, one bad record in the insert query
> can take down the entire system.
> It will be ideal if this query can automatically re-run when it failed in
> the first run and filter out the "problem" records and succeed in the
second
> attempt without taking down the entire system.
> Any idea, sample code or suggestion are highly appreciated.
> LX
>
Subscribe to:
Posts (Atom)