0

I have few SQLCLR functions implementing business logic that return SqlXml data. I would also like to make the Xml Schema Definitions in the dll available in Sql Server.

It's not a 'SqlUserDefinedType', as it is used indirectly by the Xml type. However, the collections node appears under 'types' in SSMS.

I would prefer to keep the xsd along with the functions to simplify deployment. Is this possible?

  • Apparently XSDs can be deployed as part of a 'Database Project' in VS. – Jeff Sacksteder Oct 20 '15 at 18:23
  • 2
    Jeff, does your comment mean that you have figured this out, or do you still need some help? – Solomon Rutzky Oct 20 '15 at 18:37
  • No I currently have a simple c# class project that builds an assembly, which I deploy by hand. A SSDT-BI 'database project' is not the same as what I have and presents other questions beyond this one. I still haven't found an answer. – Jeff Sacksteder Oct 20 '15 at 23:32
  • Jeff, so now I am even more confused. What exactly do you have, what exactly do you want, and what exactly are you stuck on? I was able to create a simple SSDT / SQLCLR project and include an XSD that deploys with the Assembly. Of course, I am using a regular Database project, not a BI / SSIS project. – Solomon Rutzky Oct 23 '15 at 2:01
  • You can make a standard c# visual studio project to create SQLCLR objects, including procedures, functions and types. Just copy the resulting assembly to the SQL Server and use CREATE ASSEMBLY in tsql. However, it appears that schema definitions can only be deployed through database projects. Database projects maddening disallow embeddedresources, so xml documents can't be included in a project as standalone files. They have to be added to a class as string literals, which just horrid. I Quit. – Jeff Sacksteder Oct 24 '15 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.