SET NOCOUNT

23/11/2004 - 10:43 por Pipe | Informe spam
¿Existe alguna forma de saber a que valor está establecido SET NOCOUNT { ON
| OFF }? Para poder cambiar el estado y luego dejarlo como se encontraba
originalmente

Gracias
 

Leer las respuestas

#1 Rubén Vigón
23/11/2004 - 11:15 | Informe spam
Puedes usar la función @@OPTIONS; por ejemplo:

SET NOCOUNT ON
IF @@OPTIONS & 512 > 0
PRINT 'SET NOCOUNT está ON'
ELSE
PRINT 'SET NOCOUNT está OFF'
SET NOCOUNT OFF
IF @@OPTIONS & 512 > 0
PRINT 'Ahora SET NOCOUNT está ON'
ELSE
PRINT 'Ahora SET NOCOUNT está OFF'

Un saludo!

Rubén Vigón
Microsoft MVP Visual Basic
http://www.mvp-access.com/rubenvigon

Preguntas similares