I'm wondering if there is a easy way to get a create table syntax for stored procedure's return.
For example we have a stored proc:
CREATE PROCEDURE [dbo].[usp_branches]
AS BEGIN
select * from branches
END
and then I need something like this
insert into @tempBranches
exec usp_branches
Is there a way that I can easily get create table syntax from stored procedure's return? So for this example I will get this
DECLARE @tempBranches TABLE
(
BranchID int
,BranchName varchar(25)
)