0
I have a system in Classic Asp, and I need to run a specific SQL Server process, according to a parameter that the system receives from a form.
I tried to do so:
if tipoagenda = 1 then
ssql1 = "exec VerificaDataDisponivel"
elseif tipoagenda = 2 then
ssql1 = "exec VerificaDataDisponivel_Pedido"
else
ssql1 = "exec VerificaDataDisponivel_Reagenda"
end if
or so:
.CommandType = adCmdStoredProc
if tipoagenda = 1 then
.CommandText = "HorarioDisponivelHomolog"
elseif tipoagenda = 2 then
.CommandText = "HorarioDisponivelHomolog_Pedido"
else
.CommandText = "HorarioDisponivelHomolog_Reagenda"
end
But it gives error saying: 'if' expected on line 31 end'
It is possible to do this?
use without the
then
, in the end you sendexec(ssql1)
that it will run the query that you generated!– Marconi
I took the then and the error appeared: 'Then' expected
– mmooser
Here has a good example!
– Marconi