T-SQL Vs. Managed Code

Apr 11, 2007

Can anyone explain to me why I would choose one over the other? Please provide some simple examples of when I would choose each.
 Thanks!
 

View 4 Replies


ADVERTISEMENT

SQL Schema And Managed Code (SQL-CLR)

Nov 20, 2006

I have a SQL Server project in Visual Studio 2005 which deploys an assembly to SQL Server 2005 containing various stored procedures user defined functions.  Is there any way to tell Visual Studio to drop/create the stored procedures in a schema other than dbo? 
 
ie:  User.ChangePassword instead of dbo.ChangePassword.
 

View 2 Replies View Related

Database Trigger To Run Managed C# Code

Aug 24, 2007

Hi there,
Values in my database need to updated periodically. The code, upon starting the application, queries the database and stores the values in the Application collection. This is to avoid making a database call everytime the values are needed (increases performance). The drawback is that changes to the database values are not updated in the code.
How can I create a database trigger that will update the C# Application colllection whenever a table value is updated?

View 2 Replies View Related

Managed Code Memory Issues

Apr 19, 2007

There is an interesting article from MSDN Magazine titled "Identify and Prevent Memory Leaks in Managed Code"

http://msdn.microsoft.com/msdnmag/issues/07/01/ManagedLeaks/default.aspx



Are there any additional documents or utilities that people would suggest for monitoring and managing CLR impact on SQL server resources and performance?

View 1 Replies View Related

Config Files For .Net Code In Managed Sprocs

Oct 3, 2006

I have been attempting to create a managed stored procedure which calls a web service using WSE 3.0 for security.

It appears that the WSE-generated config file (or possibly the app.config file) is not accessible to the .Net code.

Is there a method for using config files with CLR managed sprocs?


Thanks,
Max

View 1 Replies View Related

RCW Proxy Is Not Be Able To Provide Messages To My Managed Code

Jan 10, 2007

Hi everyone,

Primary platform is Framework 2.0

Our current service throws on-demand .DTSX and now we'd like that will throw old ETL 2000 too.

I'd like to know if success or not success when calling dtspkg.dll from my managed code (vb).
Is it possible or not? I only capture errors for the sake of TRY..END TRY but I don't know how the hell to know
if the dts execution was successful.
Execute method not returns anything.

Currently my schema is the following:

paquete = New DTS.Package2

paquete.LoadFromSQLServer("SRVDESA1", , , DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, _
, , , "pruebaenric")

paquete.FailOnError = True


Try
paquete.Execute()

Catch ex As Exception
' stuff
End Try

paquete = Nothing



I've tried to use WITHEVENTS but it's useless at all from there.

Events are not fired. I though that RCW created for this could be able to call them...

Private Withevents paquete as dts.package2

Private paquete_OnError()
stuff
Private paquete_OnProgress()
stuff

Thanks for any input related with,

View 3 Replies View Related

Creating Triggers Using Managed Code In SQL Server 2005

Mar 6, 2008

Hi all( Create a VB 2005 SQL Server Project ) 

i want to Create a Trigger using Managed Code in VB.Net (.NET CLR integration with SQL Server.)Somebody help me.Thanks

View 2 Replies View Related

Debug (step Into) Sql Stored Proc From Managed Code

Aug 22, 2004

I am trying to debug sql2000 sp from managed code app with VS.Net 2003 archetect Ed..
It did not stop at the break point within the sql sp.
I did granted execute permission for sp_sdidebug.
Do I need to attach any process?

Is there anything left off by the article?
I referenced msdn article option 2: http://support.microsoft.com/default.aspx?kbid=316549

Thanks.

View 3 Replies View Related

Dynamic Creation Of Temp Tables Using Managed Code

Jan 23, 2008



Hi,
I have a requirement to create #Temp table in database and insert values to it.

I use following code:

DbCommand dbCreateTable;

dbCreateTable = provider.CreateCommand();

dbCreateTable.Connection = conn;

dbCreateTable.CommandText ="Create table #MyTemp (Id varchar(10))";

dbCreateTable.ExecuteNonQuery();

string[] insertValues = {"Insert into #Mytemp values ('TestString1')",

"Insert into #Mytemp values ('TestString2')"};

DbCommand dbInsertData = provider.CreateCommand();

dbInsertData.Connection = conn;

foreach (String insertStr in insertValues)

{

dbInsertData.CommandText = insertStr;

dbInsertData.ExecuteNonQuery();

}

Code creates the Temp table but when it comes to insert statement, it throws error saying "Temp table not found".
Reason can be Create and Insert statement gets executed as 2 different sessions.
How to get the above requirement work fine?
Thank you.
HV

View 4 Replies View Related

Store The Output Of Sp_executesql - Solved With Managed Code

Apr 18, 2006

hi

I am trying to store the output of sp-executesql into a variable to implement it as a user defined function later

The function is

ALTER function [dbo].[UnitsAvailable] (@id int)

returns int

as

begin

declare @sql nvarchar(100)

declare @params nvarchar(500)

declare @count nvarchar(10)

set @sql = N'Select count(*) from units where projectid=' + convert(varchar,@id) + 'and sold=0 and displayunit=1'

set @params = N'@countOUT nvarchar(10) OUTPUT';

exec sp_executesql @sql, @params, @countOUT=@count OUTPUT;

return @count

end

The result is that I am able to parameterize the sql end execute with the right result. The only problem is that the value is not stored in the variable @count. I could get to the same result using managed code in sql 2005 but still I am curious to find out where the problem is ....

Can you please help?

Thanks Alex

View 6 Replies View Related

Managed Code In SQL Server 2005 And Stored Procedure Name Qualification

Mar 11, 2008

All --
Please help.
I am using managed code in SQL Server 2005 and have a question about stored procedure name qualification.
With a VS.NET 2005 Pro Database project, when I use >Build, >DeploySolution, it works great but my stored procedures are named with qualification using my domainusername.ProcName convention, something like this...
XYZ_TECHKamoskiM.GetData
 ...when I want them to be named with the dbo.ProcName convention, something like this...
dbo.GetData
...and I cannot see where this can be changed.
Do you happen to know?
Please advise.
(BTW, I have tried going to this setting >Project, >Properties, >Database, >AssemblyOwner, and putting in the value "dbo" but that does not do what I want.)
(BTW, as a workaround, I have simply scripted the procedures, so that I can drop them and then add them back with the right names-- but, that is a bit tedious and wasted effort, IMHO.)
Thank you.
-- Mark Kamoski

View 1 Replies View Related

Does Sql Server 2005 Enterprise Edition Support Managed Code ?

Aug 4, 2006



Dear friends,

please help,

let me tell you what happens,

1) first i installed Sql Server 2005 Enterprise Edition, everything was working fine except i was not able to create managed objects from BI, like stored procedures, triggers, UDT, etc etc.

2) so i installed VS.net 2005 complete + Sql Server 2005 Express Edition

now i was able to create stored procedures, triggers, etc etc, i'm talking about the CLR objects, ok, i.e. the managed code, but........ i was only able to do this from Sql Server 2005 Express Edition.

whenever i try to create managed objects CLR like stored procedures and stuff from the Sql Server 2005 Enterprise edition it gives me the following error :

"The Sql Server supplied by these connection properties, does not support managed code, please choose a different server"

please help meeeee.. please please, tell me what's the problem ?

below i'm attaching a screenshot of the error....



View 3 Replies View Related

Making Managed Code Calls Inside SQL Server In Context Of The Client

Aug 17, 2006

Dear all,

I am very new to the subject of writing CLR code inside SQL Server, so I apologise if my questions seem naive.

I have a requirement to populate an asp.net 2.0 GridView control with data columns, some of which are directly from a SQL Server 2005 database, but some of which are calculated by calling CLR methods passing the values from the database columns to those methods.

However, the methods I need to call only make sense in the process context of the client web site which is calling the stored procedure which I want to write to return the data columns.

In effect, I want to be able to make a remote procedure call from within the SQL Server CLR code to the methods available in the client process.

Is this possible? If so, could someone please refer me to an example of how to do it.

If it can be done, it opens up lots of very cool possibilities!

Thanks.

View 3 Replies View Related

Problem With Managed Code Simple Example Target String Size Is Too Small To Represent The XML Instance

Feb 10, 2006



I am trying to understand creating SQL Server projects and managed code. So I created a C# SQL Server Database project and named it "CSharpSqlServerProject1" and followed the steps in the following "How to: " from the Help files:

"How to: Create and Run a CLR SQL Server Stored Procedure "

I used the exact code in this "How to: " for creating a SQL Server managed code stored procedure (see below) in C#. However it didn't even compile! When I went to build the code I got the following error message:

"Error 1 Target string size is too small to represent the XML instance CSharpSqlServerProject1"

It does not give a line number or any further information! Since this is a Microsoft example I'm following I figure others must have run into this too. I can't figure out how to fix it!

Here's the code as copied directly from the howto:

using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;

public partial class StoredProcedures
{
[SqlProcedure()]
public static void InsertCurrency_CS(
SqlString currencyCode, SqlString name)
{
using (SqlConnection conn = new SqlConnection("context connection=true"))
{
SqlCommand InsertCurrencyCommand = new SqlCommand();

InsertCurrencyCommand.CommandText =
"insert Sales.Currency (CurrencyCode, Name, ModifiedDate)" +
" values('" + currencyCode.ToString() +
"', '" + name.ToString() +
"', '" + System.DateTime.Now.ToString() + "')";

InsertCurrencyCommand.Connection = conn;

conn.Open();
InsertCurrencyCommand.ExecuteNonQuery();
conn.Close();
}
}
}


Thanks for any help you can give!

View 7 Replies View Related

Managed Objects

Mar 21, 2006

Hello people :-)I'm doing some development work with Visual Studio 2005 and SQLServer 2000. My SQL DB is running on a Windows 2000 Server box in the office, and I'm doing the development on my XPPro workstation. Now I've been trying to connect to the Win2000 box though VS and although I can see the server and the DB when I hit ok I get this error"The SQL server specified by these connection propertise does not support managed objects"What the heck does that mean?any help would be great :-)

View 1 Replies View Related

Managed Replacement For SQLDMO?

Feb 23, 2006

In VS 2003 I used SQLDMO (Com Object) to list all available SQL Servers. Is in SQL Server 2005 a managed .net Component that can do that task?Thanks,Rainer.

View 2 Replies View Related

Sysindexes Vs. EM Managed Indexes

Mar 9, 2001

Can anyone explain why when I look at table using enterprise manager, highlight a table, all tasks, maanage indexes why only 1 index appears and when I look at the same table in sysindexes is says that there are 8 indexes.
This is the sql code I executed:
select object_name(id), indid from sysindexes
where object_name(id) = 'tbh_matter_summ'

Is it possible that there is a problem with the database?

TIA,
Philip

View 1 Replies View Related

MDS Entity Which Will Be Managed In Excel

Jan 7, 2015

I have an MDS entity which will be managed in excel. I do not want the user to enter the Code and Name so I have configured code to auto generate and name to default to another attribute value. I have then hidden code and name in excel.

When I use excel and enter the attribute and publish, the name column is blank in the MDS table.Am I missing something here with the defaulting?The Action is defined as 'Name Defaults to Country'. Where Country is the attribute I am populating.

View 0 Replies View Related

Managed Stored Procedures

Mar 22, 2007

Can anyone point me to a good resource to create managed stored procedures in SQL 2005 Express using VB.NET and VS2003?

View 1 Replies View Related

Managed Plugin-Algorithmn

Dec 30, 2007

Hi,

I spent the last days programming a managed datamining plugin-algorithmn for SSAS 2005 and have troubles with the Prediction-Method.

Die Prediction-Methode of the "Shell-Algorithm" leads to an error-message on execution of the prediction-query (Internal Error: Unexprected Error ... dmxpredict.cpp Row 205 ...).

Can anyone provide me with a very simple implementation of this Method which just says that for every output-attribute the first (discrete) state should be predicted with a probability of, let's say, 90 % ?

Best Whishes
Manfred

View 5 Replies View Related

Managed Trigger And New Threads

Mar 12, 2007

SQL Server 2005 gives you a possibility to create managed triggers. In a managed trigger I can create a new thread and process trigger event in various ways. My question is that are there any reasons why I should NOT start new threads in database triggers? The following code shows how I could create new threads. Do you see that this could cause any errors or problems in SQL Server functionality? My goal is to minimize the trigger effects in a database overall performance.

'This handles database updates of AdventureWorks Person.Contact table.
<Microsoft.SqlServer.Server.SqlTrigger(Name:="UpdateContact_Trigger", Target:="Person.Contact", Event:="FOR UPDATE")> _
Public Shared Sub UpdateContact_Trigger()
'Notify:
SqlContext.Pipe.Send("Trigger FIRED")

Dim triggContext As SqlTriggerContext = SqlContext.TriggerContext()
'Ensure that it was update:
If triggContext.TriggerAction = TriggerAction.Update Then

'Open a connection:
Using conn As New SqlConnection("context connection=true")
conn.Open()
'Fetch some information about the update:
Using sqlComm As New SqlCommand
sqlComm.Connection = conn
sqlComm.CommandText = "SELECT ContactID, FirstName, LastName from INSERTED"
Using rdr As SqlDataReader = sqlComm.ExecuteReader
If rdr.Read Then
'Process the data in a separate thread. The thread could send a message to MSMQ about the change
'or process if differently. The purpose of using separate thread is avoid performance hit
'in the application / database operation.
Dim oData As New TriggerData("update", rdr.GetInt32(0).ToString, "contact")
Dim trd As New Threading.Thread(New Threading.ThreadStart(AddressOf oData.ProcessEvent))
trd.IsBackground = True
trd.Start()
End If
End Using
End Using
End Using
End If
End Sub

View 2 Replies View Related

Managed Store Procedure Does Not Deploy

Sep 4, 2007

I have created a managed stored procdure in a sql server project in VS. I have put in the corect server name password and login fro the connection to the database.
When I deploy however it doesn't deploy the stored proccdure to the database even though it says it has successfully deployed the stored procedure. Has anyone had this
problem and how can you make sure it is deploying to the correct database.

View 1 Replies View Related

Multiple Connections In Managed Trigger

Apr 13, 2006

Hi All,

I am trying to open multiple connections in a Managed Trigger but encoutering an error as :

System.Data.SqlClient.SqlException: Transaction context in use by another session.

Below is the sample code:

public partial class Triggers
{

[Microsoft.SqlServer.Server.SqlTrigger (Name="TrgInsertContract", Target="Contracts", Event="FOR INSERT")]
public static void TrgInsertContract()
{
SqlTriggerContext triggContext = SqlContext.TriggerContext;
SqlConnection connection = new SqlConnection("context connection = true");
connection.Open();

SqlCommand command = connection.CreateCommand();
command.CommandText = "SELECT * from " + "inserted WHERE Active=1";
SqlDataReader reader;
reader = command.ExecuteReader(CommandBehavior.CloseConnection);
connection.Close();
SqlConnection connection1 = new SqlConnection("Initial Catalog=TestDB;Data Source=SHAIKDEV;User ID=sa;password=****");
connection1.Open();
}


Any help please ?????

Thanks...

View 5 Replies View Related

How Are Device Cals Managed And Assigned.

Aug 21, 2007

Hello all,

This seems like a simple question but I still haven't been able to get an answer from Microsoft Canada. We're looking at buying 75 device cals to connect to a single instance of SQL Server Standard Edition. Our question is on how those licenses are assigned and/or activated.

Do we need to manually do something for each station or is it an automated process done the first time a station connects to the server? We also wat to understand what happens when a workstation dies and is replaced by another one. Do you have to do something on the server to transfer the license to the new station ?

In other words, when using device cals (and/or user cals), do you have to do any type of license management or is it all transparent ?

View 1 Replies View Related

XML Source, Created From Managed DTS, Getting An Error

Oct 19, 2007

Hi,

I am stepping into the world of developing SSIS packages as part of a project I am working on, and I am kicking the tires at the moment, and I am having a couple of problems.

First, is there a really good source of 'how-to's in terms of developing against SSIS. There is plenty of documentation on MSDN/Technet, but there are NO books which cover managed DTS in ANY kind of depth.

Secondly, I am looking at bringing in an XML file programatcially, and linking in the columns I need. Works fine using the BI tools, but I get an error when I do it from visual studio.

The following code :




Code Block
IDTSComponentMetaData90 xmlinputfile;
Package package = CreatePackage("SSISPackage", "Test Package");
MainPipe pipe = AddDataFlowTask(package);
pipelineEvents = new ComponentEvents();
xmlinputfile = pipe.ComponentMetaDataCollection.New();
// configure it up...
xmlinputfile.ComponentClassID = "Microsoft.SqlServer.Dts.Pipeline.XmlSourceAdapter, Microsoft.SqlServer.XmlSrc, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91";
xmlinputfile.Name = "XML Source";
xmlinputfile.Description = "Source data in the data flow...";
CManagedComponentWrapper instance = xmlinputfile.Instantiate();
instance.ProvideComponentProperties();
// At this point you would normally associate with the runtime connection manager,
// but as it is an xml file, we do not need to do that
// We need to set the appropriate properties to look at our xml file...
instance.SetComponentProperty("XMLData", @"C:filechangedtoprotecttheinnocent.xml");
instance.SetComponentProperty("XMLSchemaDefinition", @"C:filechangedtoprotecttheinnocent.xsd");
instance.SetComponentProperty("AccessMode", 0);
instance.SetComponentProperty("UseInlineSchema", false);
// We need to set output connections....
instance.AcquireConnections(null);
instance.ReinitializeMetaData();
instance.ReleaseConnections();

IDTSVirtualInput90 vInput = xmlinputfile.InputCollection[0].GetVirtualInput();
// Iterate through the virtual input column collection.
foreach (IDTSVirtualInputColumn90 vColumn in vInput.VirtualInputColumnCollection)
{

}






When I go anywhere near the InputCollection[0], watch throws an exception, and the call to GetVirutalInput() throws the same exception which is :

System.Runtime.InteropServices.COMException was unhandled by user code
Message="Exception from HRESULT: 0xC0048004"
Source="Microsoft.SqlServer.DTSPipelineWrap"
ErrorCode=-1073446908
StackTrace:
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInputCollection90.get_Item(Object Index)
at IntegrationServicesScratchPad._Default.btnExecute_Click(Object sender, EventArgs e) in C:Documents and SettingsjMy DocumentsVisual Studio 2005ProjectsIntegrationServicesScratchPadIntegrationServicesScratchPadDefault.aspx.cs:line 75
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Does anyone have any kind of clue as to what is going on. I have seen comments on here from other people in regards to errors with input columns?? The XML files work fine in the editor as I said, and the XSD was generated by the editor using the Generate XSD option.

View 1 Replies View Related

Error Deploying Managed Stored Proc

Jul 24, 2006

When I try to deploy this managed stored proc assembly on SQL Server 2005 I get this error:
Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x8007000e. You may fix the problem and try again later
I looked on the net but found no documentation about it.  I know the CLR v2.0 is working as I have some ASP.NET apps running from this server that use it.  Any ideas?
 

View 1 Replies View Related

Access To The ADO.net Managed Provider 'SqlClientFactory' Was Denied

Apr 12, 2006

In a previous post in Installation and Setup I was having problems just getting an ASP.NET 2.0 app to run on my web server. Now I'm having some different weird security issues.
I'm getting this message when just trying to open a database and put its contents into a gridview.
Access to the ADO.net Managed Provider 'SqlClientFactory' was denied in the data source with ID 'sqlEmployees' because of security settings.
I think this may have to do with our web server and our SQL server being separate machines. That always gives us issues. But I have impersonation=true in my web.config along with windows authentication and I have SQL Server configured with Windows and SQL authentication so things should be right, I'm thinking.
Any ideas??

View 3 Replies View Related

Add User Assembly In Managed Stored Procedure

May 4, 2006

I am developing a managed stored procedure in VS.NET 2005 and I am trying to add a reference to an user developed assembly (not a system one) but adding a reference to it is not possible as it doesnt let me import assemblies but rather reference the few limited ones in a list. Why is this??

View 2 Replies View Related

Can A Managed Udf Contain A Static Dictionary&&<&&>? Is This A Wise Idea?

May 17, 2007

I currently have a udf written in T-SQL that's getting way too logically complicated!

It€™s typically accessed like this:

SELECT PartNumber,dbo.PartPrice(Manufacturer, Model, AssemblageInfo, Version, CustomerDiscountLevel) FROM WorkOrders where OrderNumber=123456

The udf does some complicated manipulations on the parameters and eventually does a SELECT on a lookup table and returns the result.

If I make this a managed code udf, the logic gets much simpler to write (great!).

But, my question is:

Can I take the lookup table and embed it in the udf--so the udf doesn't have to go to the database to do the lookup?

Would I do that in a STATIC dictionary<>?

Is it wise to keep the info statically?

The lookup table consists of 3600(+/-) elements and changes exactly once a month.

The SELECT statement using the udf typically returns several thousand rows.

The SELECT is done often.

--Mark

View 4 Replies View Related

Sp_sproc_columns Does Not Seem To Work On Managed Stored Procedures

Jul 10, 2007

Hi,



I have written a stored procedure using C#.NET. I deployed it to SQL Server, and everything works fine.



However, an Third-Party app needs to see what parameters it can use for this SP by executing sp_sproc_columns <SP name>



sp_sproc_columns

Seems to work on normal SP's written in T-SQL, but not on Managed SP's. On my SP, sp_sproc_columns does not seem to work. It does not return the parameters. On normal SP's, it does.



Anyone have an idea why this is?

View 1 Replies View Related

How Is Security To FoxPro Managed Through Linked Server From SQL

Sep 14, 2006

I€™ve been working on getting a linked server through SQL 2005 to work with VFP 9.
I get access denied for any and all security set ups on the linked server. I€™ve checked the folder-level security settings and see that the user I€™m logged in as, and have tried through security settings, and they seem to have access.
What other security settings should I be checking?

View 5 Replies View Related

Login Without Connect Permission Somehow Managed To Become Db_owner!?

Jan 9, 2007

I tried asking the same question in other forum but couldn't get an answer.

I used exactly the following SQL to create a login with sa account in SQL2k5 Management Studio:
Create Login yy With Password='yy123Z'

Without granting any permission, straight away, i log out sa and login as yy in management studio, yy somehow can access one of my ApplicationDatabase! So i check with the following SQL in my ApplicationDatabase:
IS_MEMBER('db_owner')
and it returns me 1, meaning yy is db_owner. I then quickly login as sa and double check on the security|login|yy|properties|User Mapping, NONE of the database is mapped! and i also ensure "Guest account enabled for: ApplicationDatabase" is unchecked.

What could be the problem i am facing? the purpose i create yy is to ONLY allow it to have connect permission on my SQL Endpoint. Please HELP!!

View 15 Replies View Related

Managed C++ User-defined Aggregate Function

Mar 16, 2007

Hi all,

I'm attempting to write an aggregate function in C++ to compare performance with the equivalent function in C#.

However, I'm having problems getting SQL Server to see the function in the assembly. It allows me to load the assembly into the database, but I can't see the type in it.

Here's my code:

// CPPTest.h

#pragma once

using namespace System;
using namespace Microsoft::SqlServer::Server;
using namespace System::Data::SqlTypes;
using namespace System::Data::SqlClient;

namespace CPPTest {

[Serializable]
[Microsoft::SqlServer::Server::SqlUserDefinedAggregate(
Format::Native,
Name="AGG_CPP_OR")]
public ref struct AGG_CPP_OR
{
public:
void Init();
void Accumulate(SqlInt32 Value);
void Merge(AGG_CPP_OR^ Group);
SqlInt32 Terminate();

private:
SqlInt32 m_accum;
};

}


// CPPTest.cpp

#include "stdafx.h"

#include "CPPTest.h"

void CPPTest::AGG_CPP_OR::Init()
{
m_accum = 0;
}

void CPPTest::AGG_CPP_OR::Accumulate(SqlInt32 Value)
{
m_accum = m_accum | Value;
}

void CPPTest::AGG_CPP_OR::Merge(CPPTest::AGG_CPP_OR^ Group)
{
m_accum = m_accum | Group->m_accum;
}

SqlInt32 CPPTest::AGG_CPP_OR::Terminate()
{
return m_accum;
}

Compile it with /clr:safe option and it can be loaded as an assembly into SQL Server 2005 (9.0.1399), but the AGG_CPP_OR type is not seen as an aggregate function. I've also tried implementing IBinarySerialize and setting Format to Format::UserDefined (and putting in MaxByteSize) but it makes no difference.

Does anyone know what I'm missing here?

Many thanks,

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved