1

I'm currently using a stored procedure to look up the name of a stored procedure based on a primary key in my database. I execute this initial stored procedure using LINQ to SQL. Once I have the stored procedure name I'm then using the following code to execute the stored procedure.

DbContext.ExecuteQuery(returnType, retrievedStoredProcedureName, new object[] {parameters});

The problem that I have now is that I do not know what parameters are required and what the data type is. Is there anyway to accomplish this without using SqlCommandBuilder.DeriveParameters()?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
R007
  • 378
  • 4
  • 11
  • Can't you just return the parameter information from the first procedure? How will you know what to put in those parameters? – LoekD Aug 10 '16 at 15:18
  • Yeah I could return the parameter information from the first procedure. Wouldn't I still need a way to determine what the type of the parameters are though? – R007 Aug 10 '16 at 15:55
  • Did you see this question?: http://stackoverflow.com/questions/15431523/query-to-find-number-of-parameters-in-a-stored-procedure-or-function-in-sql-serv – LoekD Aug 11 '16 at 07:24
  • @LoekD That does help some, thanks for the suggestion. – R007 Aug 11 '16 at 13:04

0 Answers0