none
temp table in one sp,can i use that temp table in another sp

Respuestas

  • Yes..

    Only  if temp table is created in first sp and 2nd sp is called with in 1st sp.. e.g bellow

    create proc sp1 as
    
    	create table #t(c char(5))
    	insert into #t(c) values('a'),('b')
    	exec sp2
    	
    
    create proc sp2 as
    	select * from #t
    
    exec sp1

    VT


    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

    • Marcado como respuesta Naresh_a martes, 06 de marzo de 2012 16:32
    martes, 06 de marzo de 2012 12:48

Todas las respuestas

  • Yes..

    Only  if temp table is created in first sp and 2nd sp is called with in 1st sp.. e.g bellow

    create proc sp1 as
    
    	create table #t(c char(5))
    	insert into #t(c) values('a'),('b')
    	exec sp2
    	
    
    create proc sp2 as
    	select * from #t
    
    exec sp1

    VT


    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

    • Marcado como respuesta Naresh_a martes, 06 de marzo de 2012 16:32
    martes, 06 de marzo de 2012 12:48
  • Read Erland's article http://www.sommarskog.se/share_data.html

    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/

    martes, 06 de marzo de 2012 12:49
    Usuario que responde