TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aniket Narvankar
551
2.1k
608.5k
Error Handling in Sql
Aug 18 2016 7:31 AM
I want to handle error while insertion in the table if wrong value is inserted it will throw an error,for this I have written following stored procedure
ALTER PROCEDURE [dbo].[Insert_Update_Test]
(
@Para varchar(50)='',
@Name varchar(50)='',
@Id int = 0
)
AS
BEGIN
Begin Try
If @Para = 'ADD'
Begin
Insert into tblTesters (Name,Id) values (@Name,@Id)
END
End Try
Begin Catch
Select ERROR_NUMBER()
END Catch
END
If I am Executing this Store Procedure
EXEC Insert_Update_Test 'ADD','1','Aniket'
If am passing value varchar to integer parameter @Id,but catch blog is not getting executed even if there is error while insertion
Please do let me know about the solution I am stuck upon this
Reply
Answers (
0
)
View and Tables
I want to skip sundays and i want two dates in amonth