¿Existe una tabla temporal?

15/09/2004 - 13:32 por poker | Informe spam
¿Como puedo comprobar si existe una tabla temporal?.¿Y si pertenece a mi
sesión o no?

Una pista:

select *
from tempdb.dbo.sysobjects (nolock)
where name like '#tmp_prueba%'
 

Leer las respuestas

#1 Tinoco
15/09/2004 - 14:20 | Informe spam
Hola, algo parecido a tu script...

if exists
(
select name
from tempdb.dbo.sysobjects
where patindex('#tmp_prueba%',name) > 0
)

Si pertenece a tu sesion ?

Hermilson T.
Colombia

¿Como puedo comprobar si existe una tabla


temporal?.¿Y si pertenece a mi
sesión o no?

Una pista:

select *
from tempdb.dbo.sysobjects (nolock)
where name like '#tmp_prueba%'

Preguntas similares