can be as below: IF EXISTS(SELECT TOP 1 1 FROM products WHERE productname = @productname) BEGIN RETURN -2 END The above means that if product name already exists the SP will return -2, then you can check the return code in your programming, and display the message for duplicate product name if return code is -2.
This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Well, couldn't get exactly what you are asking for?
Then use something like the below: Edit - the first parameter here should match the field in your model which you want to add the error too.
IF NOT EXISTS (SELECT * FROM Table_Name WHERE Column Name= @Column Name) BEGIN SET @Error Msg [email protected] Name ' Already Exists' RAISERROR (@Error Msg,11,1) return END Hope It Helps..
Click Dim mp Label As Label = Nothing Dim txt VId As Text Box = Nothing Dim txt Desc As Text Box = Nothing Dim lnk Ins Save As Link Button = Nothing Try grd Plu Grp. Add("onbeforedeactivate", "return Check ID('" grd Plu Grp.
Show Footer = True Bind PLUGrp Details SQL() mp Label = CType(Master.
So as usual, I have to sit there being pissed off and wait for her to arrive… Luckily, the computer I had been trying to dissemble was the last thing that needed to get packed up. Things between Val and I weren’t awkward anymore after Larisa told me she knew about the late night sexual antics that went on when the three of us shared a bed. She leaned back and looked at me seductively, her legs stretched out, one bent at the knee. As I had left the last room on my farewell tour, my cell phone rang. I answered and found it was my mother, letting me know she was downstairs. In the words of the referee from MTV’s Celebrity Death Match, Judge Mills Lane, “LET’S GET IT ON! The two of us shared a soft and romantic kiss in the airport terminal, just like a TV show, for about a minute. Matty,” she said as she stroked the side of my face with her hand. I don’t think that’s going to make me feel better.” Well, I tried. ” Larisa asked in a, ‘it’s a common occurrence’ way. I bet you don’t stud.” I mean, hey, Val was digging me in a big, big way and Larisa let her play with me… “There are my bags,” she said, nodding at the matching triplets that were coming out of the small dark room. “I’ll take one of them,” said Larisa, reaching for one. I’m the man here,” I grunted as I heaved them up off the ground.