Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3795038
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:01:20+00:00 2026-05-19T13:01:20+00:00

I am currently typing a script for a project of mine and currently having

  • 0

I am currently typing a script for a project of mine and currently having difficulties finding information on how to do most of the functionality MS SQL has to offer.

I am trying to figure out a way to test if an SQL statement failed its execution. For example, making an attempt to insert a record that already exists in the table. Any help would be greatly appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:01:21+00:00Added an answer on May 19, 2026 at 1:01 pm

    You can use the try/catch capabilities of SQL Server.

    Another article source and sample T-SQL:

    BEGIN TRY
      DECLARE @X INT
      -- Divide by zero to generate Error
      SET @X = 1/0
      PRINT 'Command after error in TRY block'
    END TRY
    BEGIN CATCH
      PRINT 'Error Detected'
    END CATCH
    

    E.g. Handle failures in the catch block for specific operations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to integrate a live search functionality in android. I use
I'm currently writing about dynamic typing, and I'm giving an example of Excel interop.
I am currently visually selecting the code and typing > which moves the code
Currently, I am editing my production server's crons by typing crontab -e . I
Currently I'm trying to write my first Python library and I've encountered the following
Currently, changes to the database are made through the SQL Server Management program. IF
Currently one of the machines on which I'm running has Ruby 1.8.7 installed as
I'm trying to make a bash script that will talk to a java program
I am trying out lua script with C++ in Mac OS X. I was
I am currently working on a c# project, where I need to access Outlook.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.