Jump to content
Fórum Script Brasil
  • 0

Procedure


tntgui

Question

2 answers to this question

Recommended Posts

  • 0
Guest Jeimyson

Velho, acho que isso dará certo caso for um unico registro.

-----------------------------------------------------------------------------

CREATE procedure "NOME_PROCEDURE"

(

@CAMPO1 "Tipo",

@CAMPO2 "Tipo"

)

Select @Campo1 = (Select "campo1" from "tabela")

Select @Campo2 = (Select "campo2" from "tabela")

begin

delete from "TABELA"

where Campo1 = @Campo1

and Campo2 = @Campo2

end

Link to comment
Share on other sites

  • 0

Velho, acho que isso dará certo caso for um unico registro.

-----------------------------------------------------------------------------

CREATE procedure "NOME_PROCEDURE"

(

@CAMPO1  "Tipo",

@CAMPO2  "Tipo"

)

Select @Campo1 = (Select "campo1" from "tabela")

Select @Campo2 = (Select "campo2" from "tabela")

begin

  delete from "TABELA"

where Campo1 = @Campo1

and Campo2 = @Campo2

end

----------------------------------------------------------------------

Agora, caso for varios registros aconselho que faça um CURSOR...

Velho, acho que isso dará certo caso for um unico registro.

-----------------------------------------------------------------------------

CREATE procedure "NOME_PROCEDURE"

(

@CAMPO1 "Tipo",

@CAMPO2 "Tipo"

)

Select @Campo1 = (Select "campo1" from "tabela")

Select @Campo2 = (Select "campo2" from "tabela")

begin

delete from "TABELA"

where Campo1 = @Campo1

and Campo2 = @Campo2

end

----------------------------------------------------------------------

Agora, caso for varios registros aconselho que faça um CURSOR...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152k
    • Total Posts
      651.5k
×
×
  • Create New...