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. Empty recordset

Empty recordset

Scheduled Pinned Locked Moved Database
questionalgorithmstutorial
3 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.
  • M Offline
    M Offline
    Mike Osbahr
    wrote on last edited by
    #1

    Not sure how to word this, or maybe my brain just isn't working today: I need to add records to a table. I know how to do this if I SELECT a set of data prior to adding a new record, but I would like to do it without having to do a SELECT first. Or, how do I open an empty recordset for a table? I am trying to avoid the delay of SELECT searching a large table only to come up empty. Apologies if this doesn't make sense or is ridiculously simple (see line 1). >>>-----> MikeO

    M R 2 Replies Last reply
    0
    • M Mike Osbahr

      Not sure how to word this, or maybe my brain just isn't working today: I need to add records to a table. I know how to do this if I SELECT a set of data prior to adding a new record, but I would like to do it without having to do a SELECT first. Or, how do I open an empty recordset for a table? I am trying to avoid the delay of SELECT searching a large table only to come up empty. Apologies if this doesn't make sense or is ridiculously simple (see line 1). >>>-----> MikeO

      M Offline
      M Offline
      Mike Osbahr
      wrote on last edited by
      #2

      Ok, brain kicked into gear. SELECT TOP 0 * FROM tablename >>>-----> MikeO

      1 Reply Last reply
      0
      • M Mike Osbahr

        Not sure how to word this, or maybe my brain just isn't working today: I need to add records to a table. I know how to do this if I SELECT a set of data prior to adding a new record, but I would like to do it without having to do a SELECT first. Or, how do I open an empty recordset for a table? I am trying to avoid the delay of SELECT searching a large table only to come up empty. Apologies if this doesn't make sense or is ridiculously simple (see line 1). >>>-----> MikeO

        R Offline
        R Offline
        Rein Hillmann
        wrote on last edited by
        #3

        select * from tablename where 1=2

        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