简体   繁体   English

SqlClient.SqlException:找不到列“ dbo”或用户定义的函数或聚合“ dbo.fn_rt_getlevel”,或者名称不明确

[英]SqlClient.SqlException: Cannot find either column “dbo” or the user-defined function or aggregate “dbo.fn_rt_getlevel”, or the name is ambiguous

I am sending a request in server. 我正在服务器中发送请求。

$custormerParams = array(
          "CustomerID" =>123,
          "CustomerAltID" =>'cusAlt',
          // "Participating" =>12,
          "CustClassificationID" =>12345,
          "StatusTypeID" =>1,
          // "PrimaryName" => $primaryName,
          "Email" => "test@test.net",
          // "BillingAddress" => $BillingAddress,
          // "ShippingAddress" => $ShippingAddress,
          "ShipBadAddress" =>1,
          "ShippingAddressResidential" =>1,
          "UserName" =>"test",
          "Password" =>12345678,
          "AccountNumber" =>123456789,
          "AppDate" =>"2013-06-12T16:32:34.948Z",
          "TaxID1" =>123,
          "TaxID2" =>213,
          "Stax" =>"NA",
          "Intlsin" =>"NA",
          "Phone1" =>"7795377440",
          // "Phone2" =>"NA",
          // "Phone3" =>"NA",
          // "Phone4" =>"NA",
          // "Phone5" =>"NA",
          // "Phone5" =>"NA",
          // "Phone6" =>"NA",
          // "DLNumber" =>"NA",
          // "DLState" =>"NA",
          "EnrollerDistributorID" =>1234,
          "DefaultPaymentTypeID" =>123,
          // "AccountCreditCard" => $accountCreditCard,
          // "AccountBankAccount" => $AccountBankAccount,
          "Taxable" =>1,
          "LanguageID" =>12,
          "SponsorDistributorID" =>1,
          "RefCustomerID" =>12,
          // "CustFieldValues"=>$custfieldval,
          "BillDelOff" =>12,
          "BillingAddressVerified" =>12,
          "CreditzAccountNumber" =>"NA",
          "CreditzPassword" => "234wser",
          "CustomerTypeID" => 112,
          "EmailOptOut" =>1,
          "Export" =>1,
          "Exported" =>1,
          "InstitutionNumber" => "test",
          "JoinCategoryID" => 12,
          "Mark" =>12,
          "OrigBCKey" =>12,
          "OrigEnrollerBCKey" =>0,
          "ShipDelOff" =>"NA",
          "ShippingAddressVerified" =>1,
          "TransitNumber" =>"NA",
          "UpdateDate" => "2013-06-12T16:32:34.948Z",
        );


$custormer = array(
    "APIKey" => xxxx,
    "CompanyID" => XXXX,
    "Customer" =>$custormerParams
);
$request = array(
    "Request" => $custormer
);

Passing request :- 通过要求:-

 try {


           $result = $this->client->__soapCall('Customer_CreateOnly', array($request),array(
            'uri' => 'My url',
            'soapaction' => ''
           ));

Error getting :- 错误获取:-

System.Data.SqlClient.SqlException: Cannot find either column "dbo" or the user-defined function or aggregate "dbo.fn_rt_getlevel", or the name is ambiguous.

If I will call any other function it is working fine.. 如果我要调用其他任何功能,则工作正常。

            echo htmlentities($this->client->__getLastRequest());
             echo "<pre>";
            echo htmlspecialchars($this->client->__getLastRequestHeaders()) . "\n";
            echo "hello Response:\n hello" . htmlspecialchars($this->client->__getLastResponseHeaders()) . "hello\n";
            echo htmlspecialchars($this->client->__getLastResponse()) . "\n";
            echo htmlspecialchars($this->client->__getLastRequest()) . "\n";            
            echo "</pre>";
            return $result;

        } catch (Exception $e) {
            echo "<pre>";
            echo htmlspecialchars($this->client->__getLastRequestHeaders()) . "\n";
            echo "Response:\n" . htmlspecialchars($this->client->__getLastResponseHeaders()) . "hello \n";
            echo htmlspecialchars($this->client->__getLastResponse()) . "\n";
            echo htmlspecialchars($this->client->__getLastRequest()) . "\n";
            echo "</pre>";
            return $e->getMessage();
        }

I don't know if you fixed the problem, but it might be worth checking the Table for attached Triggers. 我不知道您是否解决了该问题,但是值得检查表中是否包含触发器。 It might be that a trigger is running, on a function that no longer exists. 可能是触发器在不存在的功能上运行。 Deleting the Trigger might resolve the issue. 删除触发器可以解决问题。

Since its giving you a specific SQL error, the problem could likely be within the database itself. 由于它给您一个特定的SQL错误,因此该问题很可能是数据库本身造成的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM