Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:58:20+00:00 2026-05-26T17:58:20+00:00

I am using PHP with an odbc connection to MSSQL database. Currently, I having

  • 0

I am using PHP with an odbc connection to MSSQL database.

Currently, I having around 1900 insert statements, in the one string, separated by a semicolon, and running that in 1 odbc_execute statement.

Firstly, is this a bad method? Should I be processing every insert statement separately in a for loop?

Also, the way I am currently doing it, with 1 big statement, for some reason, only a maximum of 483 rows are being inserted with no errors. If I copy the statement that is run and run this through SQL studio, all rows insert, yet every single time, only a maximum of 483 rows insert.
Any ideas why this could be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:58:21+00:00Added an answer on May 26, 2026 at 5:58 pm

    One network round trip per INSERT will mean a lot of latency. It’ll be very slow.

    There’s probably a limit on the buffer size of all those concatenated SQL statements.

    I think you want to use a prepared statement and bound variables:

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms712553(v=vs.85).aspx

    You can still process it in a loop – two, actually. You’ll want an inner loop to add INSERTs to a batch that’s executed as a single transaction, and an outer loop to process all the necessary batches.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to connect php to Access without using ODBC connection like MySQL. Please
I'm trying to connect to an access database from a php script using ODBC.
I have connected sqlserver using ODBC in php. I'm able to connect the database
Using PHP, what's the fastest way to convert a string like this: 123 to
I am currently exporting data from php to excel using the code as below:
Using php i wants to make a join query across 2 database. This is
Using PHP I am running str_replace many times in a row to switch one
Using PHP, I am building an application that is MySQL database resource heavy, but
Using PHP against a UTF-8 compliant database. Here's how input goes in. user types
Warning for my php file.. Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.