Board index » delphi » Executing SQL-Statements serial

Executing SQL-Statements serial

Sorry! I forgot to specify the server! It's MS SQLSERVER 2000.

Hi!
Is there a way to ensure that a defined block of sql-statements(e.g.
Returning an integer field and then increasing its value) are executed
strictly one after another on the server!
Would be pleased about some hints

Sven

 

Re:Executing SQL-Statements serial


Put them in a proc.
But I also believe that they would be executed serially anyway.

Quote
"Sven Weiberg" <sweib...@hitchhiker.com> wrote in message

news:3aed7816_2@dnews...
Quote
> Sorry! I forgot to specify the server! It's MS SQLSERVER 2000.

> Hi!
> Is there a way to ensure that a defined block of sql-statements(e.g.
> Returning an integer field and then increasing its value) are executed
> strictly one after another on the server!
> Would be pleased about some hints

> Sven

Re:Executing SQL-Statements serial


    Not sure what you want but if you are looking at generating a value from
a seed table, take a look at this procedure.

CREATE PROCEDURE generatekey
@tablename char(20),
@resultval integer OUTPUT
 AS
 update keys set @resultval=keyvalue=keyvalue+1
    where tablename=@tablename

return
--
Sunil Furtado
New Mangalore Port Trust

Quote
Sven Weiberg <sweib...@hitchhiker.com> wrote in message

news:3aed7816_2@dnews...
Quote
> Sorry! I forgot to specify the server! It's MS SQLSERVER 2000.

> Hi!
> Is there a way to ensure that a defined block of sql-statements(e.g.
> Returning an integer field and then increasing its value) are executed
> strictly one after another on the server!
> Would be pleased about some hints

> Sven

Other Threads