Minimum version of Visual Studio for CLR development

  • When I install SQL Server I get the bare bones of visual studio to develop SSIS/RS/AS.

    Which is the minimum version that comes with the project templates to develop the CLR stored procs and functions?

  • Yes, and what is your question?

    When you install SQL Server, the install copies a version of the environment that you use to manage SQL Server. It also installs a version of Studio to develop SSRS reports and SSRS packages.

    Andrew SQLDBA

  • AndrewSQLDBA (3/19/2010)


    Yes, and what is your question?

    When you install SQL Server, the install copies a version of the environment that you use to manage SQL Server. It also installs a version of Studio to develop SSRS reports and SSRS packages.

    Andrew SQLDBA

    I think David's question was very clear so I think project template for all projects start with the professional edition because the standard edition did not come with Windows service template in managed languages but it comes in VC++. However all editions comes with blank templates you can use. So you could use the free version or test drive VS2010 it is in RC to RTM on April 12th 2010.

    http://msdn.microsoft.com/en-us/library/ms236405.aspx

    http://www.microsoft.com/visualstudio/en-us/products

    Kind regards,
    Gift Peddie

  • No version of SQL Server comes with these templates; these come with Visual Studio, I think you would need Professional Edition or above.

    You don't really need the templates to develop CLR stored procedures, so in principle any edition would do, or even notepad.

    In fact, all the templates really do is the steps I've outlined below, plus provide a handy mechanism for deploying direct from your Visual Studio box into the live environment. I don't miss this second feature too much.

    What you do need is to:

    1) Import the approriate libraries into your code e.g

    using Microsoft.SqlServer.Server;

    using System.Data.SqlTypes;

    2) Decorate your functions, types, etc. with appropriate attributes e.g.

    [Microsoft.SqlServer.Server.SqlProcedure] for stored procedures, SQLFunction, SQLTrigger, etc. These are not required in all cases, but I reckon it's best to use them anyway.

    3) Build the dll, using whatever version of Visual Studio you have, or even the command line compiler.

    4) Proceed as normal; load the assembly with CREATE ASSEMBLY, register the sp (or whatever) with CREATE PROCEDURE myProc AS EXTERNALNAME myAssembly.myNamespace.myProc.

    Hope this helps,

    Gavin

  • You have edited your post when I tried to answer it but I would add that the .NET Assembly class comes without a default constructor by design and SQL Server CLR by definition uses the Create Assembly key word and not the more powerful Load key word so starting with a Template is much better developer experience. I used notepad for T-SQL code before SQL Server 2005 but SMS made me to stop using notepad because it was generating useless errors when executing notepad code.

    I have also seen users saying write Asp.net pages with notepad but there are many reasons such advice is not practical. When you start with Assembly.Load you can pass in almost anything but when you start with Assembly.Create what you can do is restricted so it is better to start with templates, mileage varies.

    Kind regards,
    Gift Peddie

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply