Return SQL alert error message

Posted on 2007-07-20
Last Modified: 2012-08-13
Hello experts,

How can i simulate or return an error message in transact sql?
I knew how to do this but i forgot.
I need to return an sql error inside a procedure. something like this:
"Msg 207, Level 16, State 3, Line 1
missing value."
Question by:justaphase
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    use  RAISERROR ()
    LVL 75

    Accepted Solution

    RAISERROR ('Missing Value ', 16, 1)
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    Thanks for the Grade "B" , I hope you need to Go thru the user terms and conditions

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Introduced in Microsoft SQL Server 2005, the Copy Database Wizard ( is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now