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. General Programming
  3. C / C++ / MFC
  4. ODBC with VC++

ODBC with VC++

Scheduled Pinned Locked Moved C / C++ / MFC
databasec++sql-serversysadminhelp
5 Posts 3 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.
  • S Offline
    S Offline
    sirtimid
    wrote on last edited by
    #1

    I'm developing an app that opens a connection to a database and makes a massive import to many tables of it. To do that I open and close the tables several times in some loop statements. The problem is that, when I open a table the service of the sql server (sqlservr.exe) increases the usage of the cpu it uses. When I close the table it should release the resources, but it doesn't! Does anyone know if there is a setting of the sql server that must be changed to do that? Thanks in advance sirtimid

    D A 2 Replies Last reply
    0
    • S sirtimid

      I'm developing an app that opens a connection to a database and makes a massive import to many tables of it. To do that I open and close the tables several times in some loop statements. The problem is that, when I open a table the service of the sql server (sqlservr.exe) increases the usage of the cpu it uses. When I close the table it should release the resources, but it doesn't! Does anyone know if there is a setting of the sql server that must be changed to do that? Thanks in advance sirtimid

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      sirtimid wrote:

      The problem is that, when I open a table the service of the sql server (sqlservr.exe) increases the usage of the cpu it uses. When I close the table it should release the resources, but it doesn't!

      So are you concerned with CPU usage, or resource consumption?


      "One must learn from the bite of the fire to leave it alone." - Native American Proverb

      S 1 Reply Last reply
      0
      • D David Crow

        sirtimid wrote:

        The problem is that, when I open a table the service of the sql server (sqlservr.exe) increases the usage of the cpu it uses. When I close the table it should release the resources, but it doesn't!

        So are you concerned with CPU usage, or resource consumption?


        "One must learn from the bite of the fire to leave it alone." - Native American Proverb

        S Offline
        S Offline
        sirtimid
        wrote on last edited by
        #3

        I mean the CPU usage. So, after plenty opens of tables I have serious memory problems!!! Thanks sirtimid

        D 1 Reply Last reply
        0
        • S sirtimid

          I mean the CPU usage. So, after plenty opens of tables I have serious memory problems!!! Thanks sirtimid

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          So is it the high CPU usage, or the serious memory problems that are bothering you? It's been five years since I've used SQL Server but I do recall it having a good profiler. SQL Server, in and of itself, is a very big application. For it to continue to tax the CPU even after you've closed a table is not surprising. I would not expect that to continue for any longer than a minute or so. Memory consumption is different, however. The number(s) you see in Task Manager are a bit misleading. Read the last part of this article for an explanation.


          "One must learn from the bite of the fire to leave it alone." - Native American Proverb

          1 Reply Last reply
          0
          • S sirtimid

            I'm developing an app that opens a connection to a database and makes a massive import to many tables of it. To do that I open and close the tables several times in some loop statements. The problem is that, when I open a table the service of the sql server (sqlservr.exe) increases the usage of the cpu it uses. When I close the table it should release the resources, but it doesn't! Does anyone know if there is a setting of the sql server that must be changed to do that? Thanks in advance sirtimid

            A Offline
            A Offline
            Alfista71
            wrote on last edited by
            #5

            One problem with this sort of question is that there are so many ways to access ODBC from C++. If you are calling the SQL API with functions such as SQLExecDirect then you must remember to call SQLFreeStmt SQLDisconnect and SQLFreeConnect Also, check to see if the CPU is freed up after your program terminates. This would be an indication that the program clean up is doing something that you are forgetting to. Scooter

            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