Showing posts with label clr. Show all posts
Showing posts with label clr. Show all posts

Tuesday, March 6, 2012

2005:how to find installed assemblies

Did this as a exercise and am fed up with my fruitless searching.

Went and create an CLR assembly and all with min hassel. Now that I
have that dll out there, I am tring to find some system table or some
display in management studio that shows me where the file is located on
the hard drive and cannot locate it.

Can someone please point me in the correct location.

Thanks.LLik (wdieteri@.rmi.net) writes:
> Did this as a exercise and am fed up with my fruitless searching.
> Went and create an CLR assembly and all with min hassel. Now that I
> have that dll out there, I am tring to find some system table or some
> display in management studio that shows me where the file is located on
> the hard drive and cannot locate it.
>
> Can someone please point me in the correct location.

Use this link in Books Online:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/b2e71480-92b2-4610-a4ff-dafb121087d9.htm

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

2005 using CLR for UDF accessing DirectoryServices

Not sure if this is correct group, but I cannot access
DirectoryServices namespace (directoryservices.dll) when creating (or
running) a C# UDF.
It seems that this is a 'feature', but why - and is there a way round
it - I need to access Active Directory from the UDF.
Thanks
Howard.Generally your assembly needs 'EXTERNAL_ACCESS' or 'UNSAFE' permission set.
What error message is generated?
WBR, Evergray
--
Words mean nothing...
"HowardB" <howard.birkett@.collercapital.com> wrote in message
news:1140603708.038477.288580@.g14g2000cwa.googlegroups.com...
> Not sure if this is correct group, but I cannot access
> DirectoryServices namespace (directoryservices.dll) when creating (or
> running) a C# UDF.
> It seems that this is a 'feature', but why - and is there a way round
> it - I need to access Active Directory from the UDF.
> Thanks
> Howard.
>|||Thanks Evergray, got a response from an MVP in the dotnet.framework
group. Seems that I first have to add DirecroryServices to sql with
CREATE ASSEMBLY with unsafe permission set after turning on the
database TRUSTWORTHY - then, yes, I can add my assembly with UNSAFE
permission set- haven't tried it yet!!
H

Saturday, February 11, 2012

2005 clr returning xmldocument

I would like to return an xmldocument from a 2005 vb clr stored procedure.

This is my definition for the stored procedure. passing in a string, return xmldoc.

Can I not return an xmldoc as output? The solution will build, but not run.

Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Sub SP_Transform(ByVal cc As String, <Out()> ByVal RetValue As XmlDocument)

Error 1 Column, parameter, or variable #2: Cannot find data type XmlDocument. SqlServerProject1

Interesting question. I'll have to try it.

My gut, however, is that you should just return the XML data using the new Xml Data Type in SQL Server 2005 and just use a DataReader like dr.GetSqlXml(index) in ADO.NET to read the XML and load it into an XmlDocument.

I wrote an example of that here-

Reading XML Data Type into XmlDocument Using ADO.NET - SQL Server 2005 Tutorials

Regards,

Dave