What sql should be bulild to update or insert in follow case?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gobindap
    New Member
    • Feb 2013
    • 25

    What sql should be bulild to update or insert in follow case?

    Hi, I am using VB2010, I need to update data if it exists in the database and if it does not exists I need to insert. How to do it?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Depending on what SQL DBMS you're using, there may be merge type statement you can use. I don't know which one you're using so I can't tell you if it has one.

    Otherwise, you can do a count to see if there is a record and run the appropriate insert or update.

    Comment

    • Gobindap
      New Member
      • Feb 2013
      • 25

      #3
      Thanks for your kind support.

      That problem has been solved now. I tried first to insert and then to update, it worked successfully.

      Now I have another problem that is, how to refresh one opened form from another form? I tried to reload, call Form_Load but the result was null.

      Please help me.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        We only allow one question per thread on the forum. Please create a new thread for your new question.

        Comment

        Working...