Ver Mensaje Individual
  #1  
Antiguo 27-11-2009
peripla peripla is offline
Miembro
 
Registrado: abr 2006
Posts: 54
Reputación: 19
peripla Va por buen camino
information schema tables????

Hola, les quiero hacer una consulta....

Antes corria estas Queryes:

st:='select cast('+apostrofe+'case when Debito'+apostrofe+' + substring(column_name,7,6) + '+apostrofe;
st:=st+'- Credito'+apostrofe+' + substring(column_name,7,6)+ '+apostrofe+' > 1 then case when Credito';
st:=st+ apostrofe + ' + substring(column_name,7,6) + '+apostrofe+'>0 then ' + apostrofe+ ' as varchar(255)) c1,+ cast(substring(column_name,7,6)';
st:=st+'as varchar(255))c2 from information_schema.columns';
st:=st+' where table_Name like '+apostrofe+'tmp_afiliadossuspension_traspuesta' + id + '_' + IntToStr(anio) + apostrofe;
st:=st+' and column_name like '+apostrofe+'debito%'+apostrofe;
st:=st+' order by column_name';
qry:= AbreQuery(st);

Ahora me "obligaron" a agregarle el #, a las tablas para que sean temporales y no me funciono mas. Alguien tiene idea de como puedo hacer que funcione. Muchas gracias utilizo SQL SERVER 2000, DELPHI 5....
Responder Con Cita