mhopkins321
mhopkins321

Reputation: 3073

Checking needed parameters of stored procedure with PowerShell

I have a stored procedure in SQL Server 2008 R2 that requires some parameters to be run.

Is there a way I can dynamically check the stored procedure to see which parameters are needed? It is being called via invoke-sqlcmd in powershell

Upvotes: 2

Views: 219

Answers (1)

vonPryz
vonPryz

Reputation: 24071

There are at least three ways to get information about stored procedure parameters.

Experiment with

exec sp_help <sproc>

select * from information_schema.parameters where specific_name='<sproc>'

exec sp_sproc_columns <sproc>

and see which suits your needs best.

Upvotes: 2

Related Questions