Fórum Erro na Procedure #34973
07/07/2008
0
No exemplo de baixo funciona corretamente
CREATE PROCEDURE SEQUENCIA
as
declare @Cont Int,
@Seq int
Set @Cont = 0
set @Seq = (Select Count(*) from CadMaterial)
if (@Cont<@Seq)
UpDate CadMaterial SET Aux = @Cont,
@Cont = @Cont + 1
GO
exec sequencia
Agora quando coloco o where no update da erro na variavel cont
´ncorrect syntax near ´@Cont´.´
CREATE PROCEDURE SEQUENCIA
as
declare @Cont Int,
@Seq int
Set @Cont = 0
set @Seq = (Select Count(*) from CadMaterial)
if (@Cont<@Seq)
UpDate CadMaterial SET Aux = @Cont
[b:0aea9bc981]where Aux<10;[/b:0aea9bc981],
@Cont = @Cont + 1
GO
exec sequencia
Marceloalmeidasantana
Curtir tópico
+ 0Posts
09/07/2008
Emerson Nascimento
CREATE PROCEDURE SEQUENCIA as begin declare @Cont Int, @Seq int Set @Cont = 0 set @Seq = (Select Count(*) from CadMaterial) if (@Cont<@Seq) UpDate CadMaterial SET Aux = @Cont, @Cont = @Cont + 1 where Aux < 10 end
Gostei + 0
10/07/2008
Marceloalmeidasantana
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)