dbTalk Databases Forums  

Deploying and using Assemblies in OLAP 2005

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Deploying and using Assemblies in OLAP 2005 in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MikeP
 
Posts: n/a

Default Deploying and using Assemblies in OLAP 2005 - 07-13-2006 , 01:09 PM






I am trying to deploy my assembly. I have followed the example that
Mosha has posted at
http://sqljunkies.com/WebLog/mosha/a...x_ranking.aspx
and create a simple test function.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;

namespace SqlTestAssembly
{
public class MyClass
{
public static int myValue()
{
return 5;
}
}
}



Next I deployed the compiled dll to the Server and the Database using
the Register Assembly Pages.

Next I add my dll to the GAC.

When I run "select SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]"

I get the error

Executing the query ...
Query (1, 9) The '[SqlTestAssembly].[MyClass].[myValue]' function does
not exist.
Execution complete

Any Ideas?


Reply With Quote
  #2  
Old   
Jeje
 
Posts: n/a

Default Re: Deploying and using Assemblies in OLAP 2005 - 07-13-2006 , 05:41 PM






prefix the function call:
select [Name of the assembly].SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]

[Name of the assembly] is the name assigned to the assembly into AS
(when you insert a new assembly, you have to provide a name.)

So, if you publish 2 times the same assembly using 2 different names, you
can access each one separatly:
select [Name of the assembly1].SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]
select [Name of the assembly2].SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]



"MikeP" <MPeverill (AT) gmail (DOT) com> wrote

Quote:
I am trying to deploy my assembly. I have followed the example that
Mosha has posted at
http://sqljunkies.com/WebLog/mosha/a...x_ranking.aspx
and create a simple test function.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;

namespace SqlTestAssembly
{
public class MyClass
{
public static int myValue()
{
return 5;
}
}
}



Next I deployed the compiled dll to the Server and the Database using
the Register Assembly Pages.

Next I add my dll to the GAC.

When I run "select SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]"

I get the error

Executing the query ...
Query (1, 9) The '[SqlTestAssembly].[MyClass].[myValue]' function does
not exist.
Execution complete

Any Ideas?




Reply With Quote
  #3  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Deploying and using Assemblies in OLAP 2005 - 07-17-2006 , 06:37 AM



Jeje is right. It is the name that you give to the assembly when you
deploy it that is important. From the testing I have done the only other
syntax that appears to work is:

[Name of the assembly].myValue()

BOL says that you can call an AS Stored Proc just using the function
name, but this appears to be incorrect (I have sent BOL feedback on
this)

--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <uBOcx1spGHA.4960 (AT) TK2MSFTNGP04 (DOT) phx.gbl>, willgart (AT) hotmail (DOT) com
says...
Quote:
prefix the function call:
select [Name of the assembly].SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]

[Name of the assembly] is the name assigned to the assembly into AS
(when you insert a new assembly, you have to provide a name.)

So, if you publish 2 times the same assembly using 2 different names, you
can access each one separatly:
select [Name of the assembly1].SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]
select [Name of the assembly2].SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]



"MikeP" <MPeverill (AT) gmail (DOT) com> wrote in message
news:1152814146.532654.73930 (AT) i42g2000cwa (DOT) googlegroups.com...
I am trying to deploy my assembly. I have followed the example that
Mosha has posted at
http://sqljunkies.com/WebLog/mosha/a...x_ranking.aspx
and create a simple test function.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;

namespace SqlTestAssembly
{
public class MyClass
{
public static int myValue()
{
return 5;
}
}
}



Next I deployed the compiled dll to the Server and the Database using
the Register Assembly Pages.

Next I add my dll to the GAC.

When I run "select SqlTestAssembly.MyClass.myValue() on 0 from
[Adventure Works]"

I get the error

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.