Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/07/2010, 13:35
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 18 años, 9 meses
Puntos: 39
Respuesta: linked server y variables

Prueba si:
Código SQL:
Ver original
  1. SET @qry = 'select count(*)as total from db.'+ @Tabla + ' where Fecha=' +@Fecha
  2. SELECT @Registros=total FROM OPENQUERY(localhost, @qry)
De qué tipo es @fecha?
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.