This project has moved. For the latest updates, please go here.

ExecuteSQl Function Does exist

Topics: Developer Forum
Nov 7, 2014 at 7:32 PM
Edited Nov 7, 2014 at 7:34 PM
I created The DLL using the following in .NET
using System;
using System.Data;
using System.Data.OleDb;
namespace ASSP
{
public class SQLQuery
{
    public static DataTable ExecuteSQL(string connectionString, string sql)
    {
        OleDbConnection conn = new OleDbConnection(connectionString);

        DataTable dt = new DataTable("Results");
        OleDbDataAdapter da = new OleDbDataAdapter(sql, conn);
        da.Fill(dt);
        return dt;
    }
}
}

Then I Imported The DLL in SSAS solution
And in SSAS Action Expression I used the following
"Call ASSP.SQLQuery.ExecuteSQL('Provider=SQLNCLI;server=LocalHost;database=SD;trusted_connection=yes','exec [dbo].StoredProcedure');"

Then I Deployed My Cube solution
And in the Analysis Server , I set the Assembly properties to Impersonation=Default and Permission Set=Unrestricted

Then I go to excel 2010 and right Click on my data Then Click on Additional Actions , I get An Error
Query (1,6) The '[ASSP].[SQLQuery].[ExecuteSQL]' Function Does not Exist.
I would I appreciate any help on this.
Thank You
Hnn
Coordinator
Nov 8, 2014 at 12:16 AM
What name did you give the assembly object when you deployed it (ie. what do you see in the assemblies folder under your database in SSMS)?

Because you should be using that name as the prefix to the function name eg [<AssemblyObjectName>].ExecuteSQL(...)

You should be able to open an MDX window in SSMS connected to your database and test that your assembly is working by running something simple like "SELECT * FROM INFORMATION_SCHEMA.TABLES"
Marked as answer by furmangg on 11/10/2014 at 10:34 AM