1
我試圖將proc名稱傳遞給procedureNamePattern,並且該過程似乎將返回所有過程的所有元數據。我傳入一個空字符串,並得到相同的結果。sp_getProcedureColumns
下面是使用的代碼:
using (AdsCommand command = new AdsCommand { CommandText = "sp_getProcedureColumns",
Connection = connection,
CommandType = CommandType.StoredProcedure })
{
AdsParameter param = new AdsParameter("@procedureNamePattern", DbType.String) {
Direction = ParameterDirection.Input, Value = originalProcedureName };
command.Parameters.Add(param);
AdsParameter param0 = new AdsParameter("@catalog", DbType.String) {
Direction = ParameterDirection.Input, Value = null };
command.Parameters.Add(param0);
AdsParameter param1 = new AdsParameter("@schemaPattern", DbType.String) {
Direction = ParameterDirection.Input, Value = null };
command.Parameters.Add(param1);
AdsParameter param2 = new AdsParameter("@columnNamePattern", DbType.String) {
Direction = ParameterDirection.Input, Value = null };
command.Parameters.Add(param2);
sp_getProcedureColumns返回我需要的元數據。當我傳入proc名稱時,它會返回所有過程的所有元數據。我只想要我傳入的過程的元數據。 – hsedidin 2010-08-26 19:51:09
爲什麼我應該在sp_getProcedureColumns應該返回元數據時使用DeriveParameters。我已經知道該過程返回的參數是什麼。我只想要它返回我傳入的過程名稱的參數。 – hsedidin 2010-08-26 19:55:41
@hsedidin,對不起 - 我應該直接回答這個問題。我會更新它。 – 2010-08-26 20:36:14