Visual Basic - UPDATE - SQL

Life is soft - evento anual de software empresarial
 
Vista:

UPDATE - SQL

Publicado por Alexandre (19 intervenciones) el 29/06/2005 19:47:04
Estimados Latinos:

Estoy con dificultades de hacer que dos instrucciones update (sql), sea hecha en una solo linea:

Hoy tengo

selecao = "UPDATE TABELA_PEDIDOSDETALHESLOTEfat set loteroths='" & TxtNLote.Text & "' WHERE loteroths='" & TxtLotRoths.Text & "'"
bd.Execute (selecao)

selecao = "UPDATE TABELA_PEDIDOSDETALHESLOTEFAT set loteband='" & TxtNBand.Text & "' WHERE loteband='" & TxtBand.Text & "'"
bd.Execute (selecao)

¿Es possible hacer las dos instrucciones con un “AND” ?

selecao = "UPDATE TABELA_PEDIDOSDETALHESLOTEfat set loteroths='" & TxtNLote.Text & "' WHERE loteroths='" & TxtLotRoths.Text & "' AND UPDATE TABELA_PEDIDOSDETALHESLOTEFAT set loteband='" & TxtNBand.Text & "' WHERE loteband='" & TxtBand.Text & "'"

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:UPDATE - SQL

Publicado por Miguel ! (49 intervenciones) el 30/06/2005 00:06:50
No se puede hacer con un AND en lugar de eso hazlo con un GO, en SQL Server la instrucción GO le indica a SQL que terminando de hacer una instrucción empieze con otra y seria algo asi

update tabla set campo=1
GO
update tabla2 set campo=2
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar