Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to store stored proc results to a temp table

How to store stored proc results to a temp table

Scheduled Pinned Locked Moved Database
tutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DotNetXenon
    wrote on last edited by
    #1

    insert into #temp exec dbo.MyStoredProc 89,1 (MyStoredProc requires 2 integer parameters.) The above works fine but in my stored proc where I write this insert statement, I need to create the #temp table and MyStoredProc results in 100 columns. Only 5 columns have to be stored in #temp. I need something like below. (As you would know, am making it clear, below does not work!!) select col1,col2,col3,col4 into #temp exec dbo.MyStoredProc 89,1

    ------------------------------------------------------------ "The only true wisdom is in knowing you know nothing." --Socrates

    V 1 Reply Last reply
    0
    • D DotNetXenon

      insert into #temp exec dbo.MyStoredProc 89,1 (MyStoredProc requires 2 integer parameters.) The above works fine but in my stored proc where I write this insert statement, I need to create the #temp table and MyStoredProc results in 100 columns. Only 5 columns have to be stored in #temp. I need something like below. (As you would know, am making it clear, below does not work!!) select col1,col2,col3,col4 into #temp exec dbo.MyStoredProc 89,1

      ------------------------------------------------------------ "The only true wisdom is in knowing you know nothing." --Socrates

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      If i understand you well, you want to insert records into a Temp table and you expect to have atleast 100 records because the Source have atleast 100 records and what you get in that temp is 5recs?

      Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups