-
capturing Data type mismatch error
Hi All,
Create Table tb_mismatch
(x int)
Create Procedure proc_mismatch
as
begin
insert into tb_mismatch values('s')
if @@error<>0
begin
print ' entered error loop'
end
print 'successfully exited'
end
Now, when i try to capture the above error its not getting trapped..its directly going to the final end statement.
I have even tried calling subprocedures so that it comes out of the inner procedure and by some means i can move forward in the outer proc,but even that helped out..
The proc. is able to capture all the other errors like primary key voilation,binary data truncated but not the datatype mismatch error (mainly int with varchar...)
any ideas are greatly appreciated.
Thanks & regards,
Pavan.
-
Some errors are not captured by @@error, that is a flaw in T-SQL. MS has corrected that in SQL 2005.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|