Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. inserting values by checking the existing values

inserting values by checking the existing values

Scheduled Pinned Locked Moved Database
tutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dsaikrishna
    wrote on last edited by
    #1

    Dear all, i am a novice programmer to sqlserver i just want a condition for how to insert the values into 3 tables of data at a time by considering that the three tables contains values if one of the table does not contain any values then it wont to be inserted into any of the tables

    sai krishna

    E 1 Reply Last reply
    0
    • D dsaikrishna

      Dear all, i am a novice programmer to sqlserver i just want a condition for how to insert the values into 3 tables of data at a time by considering that the three tables contains values if one of the table does not contain any values then it wont to be inserted into any of the tables

      sai krishna

      E Offline
      E Offline
      Eliz k
      wrote on last edited by
      #2

      Not sure if this is what you want... IF EXISTS (SELECT TOP 1 1 FROM tblTable1 WHERE col1 = 'abc') AND EXISTS (SELECT TOp 1 1 FROM tblTable2 WHERE col2= 'def') AND EXISTS ( SELECT TOP 1 1 FROM tblTable3 WHERE col3= 'xyz' ) --Do Something ELSE --Do Nothing Eliz.K www.oin1.com

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups