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
 General SQL Server Forums
 New to SQL Server Programming
 Dynamic Temp Table

Author  Topic 

PUTTU PATIL
Starting Member

7 Posts

Posted - 2014-06-09 : 11:02:26
Hi All,

I want to generate dynamic temp table so, from one strored procedure am getting an some feilds as shown below

CM_id,CM_Name,[Transaction_Month],[Transaction_Year],''[Invoice raised date],''[Payment Received date],''[Payout date],''[Payroll lock date]

for i want to generate table for the above feilds with datatype


please help me to do so.

Regards,
Abhishek Patil

PUTTU PATIL

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-06-09 : 16:15:49
quote:
Originally posted by PUTTU PATIL

Hi All,

I want to generate dynamic temp table so, from one strored procedure am getting an some feilds as shown below

CM_id,CM_Name,[Transaction_Month],[Transaction_Year],''[Invoice raised date],''[Payment Received date],''[Payout date],''[Payroll lock date]

for i want to generate table for the above feilds with datatype


please help me to do so.

Regards,
Abhishek Patil

PUTTU PATIL

I didn't get what you meant by dynamic temp table. You can create a temp table and then use the INSERT..EXEC construct to insert the results of your stored proc into that table. See here: http://www.sommarskog.se/share_data.html
Go to Top of Page

PUTTU PATIL
Starting Member

7 Posts

Posted - 2014-06-10 : 01:52:01
Hi All,

I have created a stored procedure for retrieving column name, as shown below
CM_id, CM_Name, [Transaction_Month], [Transaction_Year], [Invoice raised date],[Payment Received date],[Payout date],[Payroll lock date]

now i trying to create a temporary table using the above generated coluimns from Stored Procedure with datatype.


PUTTU PATIL
Go to Top of Page
   

- Advertisement -