0 down vote favorite INSERT INTO Test EXEC p4_Proc

I don't want to use a temp table. I want the information from the store procedure to go to a table I have created. The store procedure only generates 5 columns but I have added a date column and another column that requires update from time to time. So want am trying to do is to make the stored procedure to fill in the date column with a getdate()/date and time of when the stored procedure was ran and update the other column with the new information entered from the application
toheeb belloAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Data DudeCommented:
If you do a INSERT INTO table_name EXEC stored_procedure_name then that requires the same columns and data types, and you cannot do an 'EXEC stored_procedure_name, GETDATE() as other_name' with other columns.

The only way around it is to insert into a temp table, then INSERT from there to your table_name including other columns.

Or manipulate your stored procedure to include everything you wish to INSERT.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
toheeb belloAuthor Commented:
Thanks Jim, so what I did was to insert into the Stored procedure the new column as advised.

Thanks for your help.
toheeb belloAuthor Commented:
Thank Jim for your help. really appreciate
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.