0
Well, I’m trying to execute the command below, but it’s always giving error, someone knows why?
declare @maquinaCount varchar(max);
declare @maquinaOnline varchar(max);
select @maquinaCount = 'select count(id) from Indigo_Nextel_Portabilidade_Dev6.bko.OnlineMachine';
select @maquinaOnline = 'select count(id) from Indigo_Nextel_Portabilidade_Dev6.bko.OnlineMachine where bol_online = 1';
exec(@maquinaOnline);
exec(@maquinaCount);
insert into TB_METRICA(Metrica_Nome, Metrica_MaquinaQuant, Metrica_MaquinaOnline) values('Nextel Portabilidade', exec(@maquinaCount), exec(@maquinaOnline));
What error? If you do not specify the error it is very difficult to suggest an answer
– Sorack
the variables are not carried out.
– igor3k
And there’s some special reason you use exec instead of just throwing the value at variables?
– Sorack