Showing posts with label party. Show all posts
Showing posts with label party. Show all posts

Tuesday, March 27, 2012

adhoc queries

Hello

We got third party software, we are using adhoc queries more for the Applications (i am checking the DB Dashboard, it is showing as 97% CPU for adhoc queries). Could any one suggest how to tune SQL Server (at server level) for adhoc queries, we can not change the code now.

Let me know how to improve the SQL Server, whenever 3rd party applications use adhoc queries more?

Thanks in advance.

You can use DTA for this.

http://msdn2.microsoft.com/en-us/library/ms186354.aspx

You will want to use sql profiler to capture a trace/workload for DTA.

Friday, February 24, 2012

Adding Externall DLL functions written in Visual C++

Hi,

I'm trying to add exernal functions defined by a third party in a dll. They developed the dll in Visual C++ and is provided as is, with very little additional info about the code. The dll is tested and can be integrated into an application developed with VB.NET but no other experiences are available. I tried to add the functions to SQL Server 2005 Express edition but on attempting to CREATE the ASSEMBLY i get the following error:

CREATE ASSEMBLY for assembly 'ThirdPartyDll' failed because assembly 'ThirdPartyDll' is malformed or not a pure .NET assembly.

Unverifiable PE Header/native stub.

No rows affected.

(0 row(s) returned)

@.RETURN_VALUE = -6

Finished running [dbo].[ThirdPartyDll].

Is there an alternative way to add these functions for non pure .NET assemblies, or in general, is there a workaround to solve the problem?

By the way, do i need to register the dll with RegSvr32 first?

Thanks,

Marco.

Your third party dll is probably a COM dll.

You will have to use interop to create a .Net wrapper for the com dll. Both the dll's will have to be installed on your server (yes - you'll have to regsvr32 the original dll). When creating the assembly on the database you'll have to specify unsafe so that you may access external code.

It is not very recommended that you call C++ COM dll's from sql's clr...