Re: ADO and Cursors with MSSQL
From: Arnie Mauer (xxx_at_nowhere.net)
Date: 03/25/04
- Next message: Martin Plourde: "Re: Server Cursor with Joined Tables"
- Previous message: Eduardo Martinez: "Re: BCD overflow"
- In reply to: Schlup Herbert: "ADO and Cursors with MSSQL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 25 Mar 2004 15:30:25 -0500
"Schlup Herbert" <hschlup@external.ch.nospam> wrote in message
news:4060a5e6$1@newsgroups.borland.com...
>
> Hi All
>
> I have a programm that uses ADOConnection with MSSQL. I like to insert
about 100'000 records. No I saw, that when I use parameters with my
Insert-Statement, the memory used by MSSQL is not so heavy increasing as
when i use a specific Insert-SQL Statement for each row.
>
> I think this is because ADO creates a cursor for each insert. Now, in
several cases I have to use this 2nd possibility. So how can I free the
cursors so that the SQL-Server can free the memory?
>
> The problem is that the server is taking memory, and he never free's it.
>
> Herbert
One possibility. SQL Server will cache SQL statements. Therefore, if you
repeatedly issue the same parameterized statement, the cached statement,
which is already parsed, will be used. In your second case, each individual
statement is cached and never used again. It is always preferable to use
parameterized statements.
- Arnie
- Next message: Martin Plourde: "Re: Server Cursor with Joined Tables"
- Previous message: Eduardo Martinez: "Re: BCD overflow"
- In reply to: Schlup Herbert: "ADO and Cursors with MSSQL"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|