troubleshooting Question

Variable in Raise Error

Avatar of bmiller250
bmiller250 asked on
Microsoft SQL Server 2005
4 Comments1 Solution966 ViewsLast Modified:
Server: MS SQL Server 2005 Standard Edition

I have this snippet in a stored procedure and I will like to include the Item Key in the raise error text

        -- ///
      -- ///  ensure stock number is valid
       -- ///
      IF ( (SELECT itm_key FROM Item WHERE itm_key=@itm_key) IS NULL )
            BEGIN
                  RAISERROR (' : stock number is not valid' , 16, 1)
            END
 
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros