problema sp_send_dbmail y envio query

08/03/2007 - 18:30 por Jesus Suarez | Informe spam
TEngo este problema, ejecuta esta sentencia:

set NOCOUNT ON

EXEC msdb.dbo.sp_send_dbmail
@recipients = 'JESUS.SUAREZ@MANTELNOR.COM',
@PROFILE_NAME='PERFILMAILADMINISTRADOR',
@body = 'Body of text is here', @subject = 'My Subject',
@query = 'Select * from BGESTION.DBO.BGESTION_TM_PAISES',
@attach_query_result_as_file = 0,
@query_result_header = 0,
@exclude_query_output = 1

EXECUTE MSDB.DBO.SYSMAIL_START_SP

y obtentgo este resultado:

Body of text is here

1 España

2 Portugal

3 Alemania

4 Inglaterra

(4 rows affected)

no quiero que me salga el numero de filas afectadas, como puedo hacer para
eliminar ese mensaje
 

Leer las respuestas

#1 Carlos Sacristan
08/03/2007 - 19:56 | Informe spam
Prueba anteponiendo SET NOCOUNT ON a la sentencia SELECT

"Jesus Suarez" escribió en el mensaje
news:
TEngo este problema, ejecuta esta sentencia:

set NOCOUNT ON

EXEC msdb.dbo.sp_send_dbmail
@recipients = '',
@PROFILE_NAME='PERFILMAILADMINISTRADOR',
@body = 'Body of text is here', @subject = 'My Subject',
@query = 'Select * from BGESTION.DBO.BGESTION_TM_PAISES',
@attach_query_result_as_file = 0,
@query_result_header = 0,
@exclude_query_output = 1

EXECUTE MSDB.DBO.SYSMAIL_START_SP

y obtentgo este resultado:

Body of text is here

1 España

2 Portugal

3 Alemania

4 Inglaterra

(4 rows affected)

no quiero que me salga el numero de filas afectadas, como puedo hacer para
eliminar ese mensaje


Preguntas similares