Q:

Passing a Variable to a system stored procedure

I am sure I am missing something simple. I am looking to map some of my data objects. I wanted to create a procedure would insert the results of sp_depends and insert data name. 
Here is what I have created:
create table DatasetMapping 
(
    Name nvarchar(257),
    Type nvarchar(16),
    updated nvarchar(7),
    Selected nvarchar(8),
    Column sysname
);

Insert into DatasetMapping
    exec sp_depends 'dbo.PositionReport_Quote_V3_2016'

This works great manually.
I then created 
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[Repotingdatasets]
AS   
    DECLARE @object NVARCHAR(257)

    INSERT INTO DatasetMapping
        EXEC sp_epends  @objname = @object 

    EXEC [dbo].[Repotingdatasets] @object =' dbo.PositionReport_Quote_V3_2016';

but I only get an error:

Msg 8146, Level 16, State 2, Procedure Repotingdatasets, Line 0 [Batch Start Line 48]
  Procedure Repotingdatasets has no parameters and arguments were supplied

A:

You don't declare the variable like that if you intend to pass it.  You're looking for this:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[Repotingdatasets] @object nvarchar(257)
AS   
BEGIN

INSERT INTO DatasetMapping
EXEC sp_depends  @objname=@object

END

Then..
EXEC [dbo].[Repotingdatasets]  @object =' dbo.PositionReport_Quote_V3_2016';

If you want a default value add it to the same spot:
CREATE PROCEDURE [dbo].[Repotingdatasets] @object nvarchar(257) = 'default'

