Advertisement
skorpk

Untitled

May 12th, 2022
1,533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.45 KB | None | 0 0
  1. create procedure dbo.test1
  2. as
  3. begin
  4.     IF OBJECT_ID('tempdb..#t') IS NOT NULL DROP TABLE #t
  5.     select 1 as Col1, 2 as Col2 into #t
  6.     exec test2
  7. end
  8. go
  9. ---------вторая вызываемая ХП---------------
  10. create procedure dbo.test2
  11. as
  12. begin
  13.     IF OBJECT_ID('tempdb..#t') IS NOT NULL DROP TABLE #t
  14.     CREATE TABLE #t(Col1 int, Col2 int, Col3 int)
  15.  
  16.     insert into #t(Col1,Col2) values(4,5),(8,9)
  17.      update #t set Col3 = 24
  18.     select * from #t
  19. end
  20. go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement