Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Create Table Using Stored Procedure

Author  Topic 

doco
Yak Posting Veteran

77 Posts

Posted - 2009-10-29 : 12:19:43
I am using the following stored procedure

exec
ManatronWheelerCustom..sp_CrossTab
'select property_id, tax_year, value_type, initial_value from AscendWheelerMain..val_component',
NULL,
NULL,
value_type,
initial_value,
SUM,
NULL


and it returns exactly what I desire. I would like to create a table using this stored procedure.

Ideas?

TIA

Education is what you have after you've forgotten everything you learned in school

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2009-10-29 : 12:22:16
If you wnat to data in a table then try this
select ...... into table-name from

========================================
Project Manager who loves to code.
===============
Ask to your self before u ask someone
Go to Top of Page

doco
Yak Posting Veteran

77 Posts

Posted - 2009-10-29 : 12:37:59
Thanks.

I am aware of that process but really do need to create the result set using the sp_CrossTab stored procedure as I do not want to create a select query with 56+/- joins to the val_component table...

Education is what you have after you've forgotten everything you learned in school
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-30 : 02:43:04
Try method 2
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -