Bit of a complicated one this as it requires knowing very little from the start except that each stored procedure returns a single dataset (which is a temp table).

I can't use OPENQUERY or OPENROWSET

I'm using SQL server 2012

What I would like to do is have a single point of entry which builds a me a string.

```
CREATE PROCEDURE BuildMeAString (@spname varchar(30))
AS

  -- select results from a stored procedure

  SELECT * INTO #temp FROM @spname

  -- get the column names to build the first record of the JSON string

  -- loop through the rows and build a JSON string for each row

GO

```

I'd like it this sort of way so I can change any stored procedure being called without needing to have it formatted in a standard way

Is this even possible?