Showing posts with label procs. Show all posts
Showing posts with label procs. Show all posts

Sunday, March 11, 2012

Access to statistical functions in stored procs

Is there anyway I can use the Correlation function in a stored proc? The
correlation function is part of OLAP. I have an application which requires
the display of the correlation coefficients between a base data set and many
instances of another data set. If I can't use the Correlation function in
OLAP, does anyone have suggestions of what I might be able to use?
AlanS
If this is for T-SQL and not MDX queries with analysis
services, then you can write your own. You can find some
examples if you search the SQL Server newsgroups on google.
One such example can be found at:
http://tinyurl.com/3rlhw
Another option would be to use the correlation function in
Excel and call the Excel functions in SQL Server using the
OLE Automation stored procedures. You can find more
information on the OLE Automation stored procedures in SQL
Server books online.
-Sue
On Fri, 3 Sep 2004 08:29:09 -0700, "AlanS"
<AlanS@.discussions.microsoft.com> wrote:

>Is there anyway I can use the Correlation function in a stored proc? The
>correlation function is part of OLAP. I have an application which requires
>the display of the correlation coefficients between a base data set and many
>instances of another data set. If I can't use the Correlation function in
>OLAP, does anyone have suggestions of what I might be able to use?
>AlanS

Saturday, February 25, 2012

Access SMO objects in CLR proc

I would like to write some CLR procs that use SMO objects. In visual studio I am unable to add refrences to the SMO objects. How can I do this?

Thanks

Bert

Because CLR was designed to work within the SQL Server engine the references available for a CLR assembly are limited. The assemblies actually run within the SQL Server context, not as operating system processes.

What would you want to do using SMO that you can't do using Transact-SQL?

|||

You are unable to add them because SMO is dependent on Batchparser90.dll which is half managed/half unmanaged code, so SQL server will not load it. They don't show up in visual studio for this reason.

If you want to use assemblies that don't show up, try creating just a normal class library and then use the CREATE ASSEMBLY T-SQL command. You will have to load all of your external assemblies as well, so I would see if they load before you start writing it, as some will and some wont.

Access SMO objects in CLR proc

I would like to write some CLR procs that use SMO objects. In visual studio I am unable to add refrences to the SMO objects. How can I do this?

Thanks

Bert

Because CLR was designed to work within the SQL Server engine the references available for a CLR assembly are limited. The assemblies actually run within the SQL Server context, not as operating system processes.

What would you want to do using SMO that you can't do using Transact-SQL?

|||

You are unable to add them because SMO is dependent on Batchparser90.dll which is half managed/half unmanaged code, so SQL server will not load it. They don't show up in visual studio for this reason.

If you want to use assemblies that don't show up, try creating just a normal class library and then use the CREATE ASSEMBLY T-SQL command. You will have to load all of your external assemblies as well, so I would see if they load before you start writing it, as some will and some wont.