Insert while looping

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Insert while looping

    I'm running a query from a text file to return data that I will then use
    to insert into SQL - could someone give an example as to how to insert
    that data after it's read? or during the read?
    Dave Karmens Guest

  2. Similar Questions and Discussions

    1. What's faster - loop for insert or insert...select.
      What is faster if I'm moving large numbers of records (anywhere from 10,000 to 300,000 records per archive) from one query to another table? 1)...
    2. Multiple Insert or Looping Insert
      I built an application on an Access DB that allows a dispatcher to log trucks in the field at their location as they call in. There are three...
    3. Login - multi table insert for registrant; subsquent login insert page requests into joined 'Selection' Table
      Question regards insert and updates in sql server for a simple login script that requires registration the first time and only "email address" upon...
    4. XML and looping
      Hey guys, I have a XML file as follows: <book> <Name>I Have a Dream</Name> <Price>3.00</Price> <Description>This is a great...
    5. INSERT statement contains fewer items than the insert list
      The block of code below shows how I am inserting field values into my dbase table: strSQLStatement = "INSERT INTO tblArticles...
  3. #2

    Default Re: Insert while looping

    Dave Karmens wrote:
    > I'm running a query from a text file to return data that I will then
    > use to insert into SQL - could someone give an example as to how to
    > insert that data after it's read? or during the read?
    You're talking about SQL Server? it sounds like a job for a BULK INSERT
    query. Look it up in Books Online (BOL).

    Bob Barrows


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  4. #3

    Default Re: Insert while looping


    do while not oStream.AtEndOfStream
    oADO.Execute "INSERT INTO YOURTABLE (YOURCOLUMN) VALUES ('" &
    oStream.ReadLine & "')"
    Loop

    Ray at work


    "Dave Karmens" <spam_just1coder@yahoo.ca> wrote in message
    news:OXMSPC6$DHA.2056@TK2MSFTNGP11.phx.gbl...
    > I'm running a query from a text file to return data that I will then use
    > to insert into SQL - could someone give an example as to how to insert
    > that data after it's read? or during the read?

    Ray at Guest

  5. #4

    Default Re: Insert while looping

    Or perhaps within your loop have objRS.AddNew and then set each field...

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    [url]http://www.Bullschmidt.com[/url]
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139