How to check if select query returns null


















My example. I am deciding to ignore the issue. So the record existing meant that it didn't need to be inserted because it was already logged. With that said, I will take your answer into account in the upcoming design changes. I have a Microsoft product on one of my servers that is doing the same logic. If exists, then return key otherwise, insert with update lock.

The solution I proposed was the above, but they have not implemented it yet! Sign up or log in Sign up using Google. Sign up using Facebook.

Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Visit chat. Linked 0. Related Yes the first piece of code works now that you have edited it.

You might want to edit that bit now. Show 2 more comments. If there are zero records, nothing will be inserted by this code. McDermaid Nick. Add a comment. Sunil Kumar Sunil Kumar 1 1 gold badge 7 7 silver badges 12 12 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.

Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta.

New post summary designs on greatest hits now, everywhere else eventually. Linked 1. By signing up, you agree to our Terms of Use and Privacy Policy. Enter the email address associated with your account. We'll send a magic link to your inbox.

Email Address. All Sign in options. Enter a Email Address. Choose your interests Get the latest news, expert insights and market research, sent straight to your inbox. Newsletter Topics Select minimum 1 topic. Please help. Andres Obregon Posted February 19, 0 Comments.

Do a union query that returns 0. Sure it can. Many thanks. Ricardo Vasquez Posted February 19, 0 Comments. Ray Decker Posted February 19, 0 Comments. An option would be to use — if exists ie: if exists select Bla from Bla select statement else select 0 Ray.

Anonymous Posted February 19, 0 Comments. To determine what, if anything, you are doing wrong, we need to know what you are trying to do. Hi Sandy, I work with this type of query all the time. Thanks, Eileen. May your days get brighter and brighter, Jim P. Anonymous Posted February 21, 0 Comments.



0コメント

  • 1000 / 1000