• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

ms sql server 2005 - get results from #temp table

I am creating a sproc using #temp table and I want to see what is loaded into the #temp table before it is destroyed at the end

I try this to get the data to the results window:
PRINT #TEMP_TABLE

--doesnt work...

select col1,col2,col3 into #temp_table (select...from....

select * from #temp_table

how can I print out  the data in the columns from the #temp_table to the results window when I run the code??
0
GlobaLevel
Asked:
GlobaLevel
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
I would surprised that "select * from #temp_table" is not working. Any error message? Can you show your SP?
0
 
Ephraim WangoyaCommented:

select * from #temp_table

This should work unless there is actually no data in the temp table. Can you post the code for the stored procedure
0
 
Brendt HessSenior DBACommented:
If this is being run in code, as opposed to in SSMS or some similar tool, look at what is needed to return multiple recordsets.  Also in this case - is the method being used to execute the stored procedure prepared to receive a returned table

If this is being run in a stored procedure.. I have no idea why it would not return the data.  Does the stored procedure already return a recordset?
0
 
Andrei FomitchevCommented:
Before delete #temp_table

put

select * from #temp_table

and run your stored procedure in SSMS.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now