Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. -- passing result of SELECT to SP
  2. SELECT a, b FROM t
  3. EXEC my_sp a, b
  4.  
  5. -- passing result of SP to INSERT
  6. INSERT INTO t
  7. EXEC my_sp a, b
  8.  
  9. create table #results (col1 int, col2 varchar(5) ...)
  10.  
  11. INSERT INTO #results
  12. EXEC YourProcedure @parma...
  13.  
  14. SELECT
  15. *
  16. FROM YourTable y
  17. JOIN #results r ON ...
  18. ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement