How to get SQLCLR started in SQL Server 2005 Express via Visual Basic 2005 Express?

  • Hi all,

    I want to do SQLCLR by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express and I have read the following articles and books:

    (i) Connecting to SQL Express User Instances in Management Studio in http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-insta...

    (ii) Managing SQL Server Express with SQL Server 2005 Management Studio Express Edition in http://www.microsoft.com/technet/sql/2005/mgsqlexpwssmse.mspx

    (iii) Chapter 16 - Going Beyand Transact-SQL: Using the SQL Common Language Rutime (SQLCLR) in Microsoft SQL Server 2005 Express Edition for Dummies

    (iv) Chapter 21 - Working with the Common Language Runtime in Microsft SQL Server 2005 Programming for Dummies

    (v) Chapter 4 - Introduction to Common Language Runtime (CLR) Integration in Programming SQL Server 2005 by Bill Hamilton.

    I want to create an SQLCLR project "HelloWorld" by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express. But I am still not sure how to get it started, because I do not understand the following things:

    (1) Pipe Name for a User Instance, (2) Enabling (or Disabling) the CLR by using Transact-SQL, (3) Creating a Transact-SQL script, (4) Creating an Assembly, (5) Creating a backup device, etc. I need to see some simple examples of SQLCLR by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express. Please help and tell me where in the websites I can find them or give me your instructions to create, install and execute this basic SQLCLR project in SQL Server 2005 Express-Visual Basic 2005 Express (that has no the CLR template).

    Thanks in advance,

    Scott Chang

  • CLR integration does NOT work in Visual Studio Express or any of its components. In order to use CLR integration, you need to be licensed for Visual Studio Professional, Team Suite, or Visual Studio Tools for Office.

    here's the detail:

    capabilities by VS product line

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Hi Matt, Thanks for your response.

    I am confused now about doing SQLCLR on SQL Server 2005 Express via Visual Basic 2005 Express. Today, I saw a statement " With this book, you'll learn the basics of using SQL Server 2005 Express and hosting SQL Server Common Language Runtime (CLR) objects in the database." in http://www.yukonxml.com/chapters/mann/Express:

    Chapter 3 - SQL Server 2005 Express Tools

    Wednesday, July 6, 2005

    To order this book or to find additional details, go to http://www.rationalpress.com.

    Microsoft® SQL Server 2005™ Express is a free edition of Microsoft's flagship database product. The Express edition, which replaces MSDE, contains many of the features of other editions of SQL Server 2005, including the integration of Microsoft's .NET technology into the SQL Server platform.

    This book gives you an early look into the beta preview of SQL Server 2005 Express. It takes a rational, no-nonsense approach in a compact guide - only 224 pages. The book is written to give you the basics…fast! With this book, you'll learn the basics of using SQL Server 2005 Express and hosting SQL Server Common Language Runtime (CLR) objects in the database. With its friendly tutorial approach and numerous examples, this book will help you quickly learn how to create, configure, maintain, and deploy SQL Server 2005 Express databases. It also covers advanced topics, such as security, distributed support, and XML support.

    Technical accuracy is assured by Roger Wolter, Group Program Manager, SQL Server 2005 Express, Microsoft Corporation.

    Copyright © 2005 by Mann Publishing Group.

    http://www.mannpublishing.com

    **********************************************

    Also, I saw a brief SQLCLR result in (iii) Chapter 16 - Going Beyand Transact-SQL: Using the SQL Common Language Rutime (SQLCLR) in Microsoft SQL Server 2005 Express Edition for Dummies. Any thought or comment on this confusing information I got? Please respond.

    Thanks,

    Scott Chang

  • You can use only C# compiler to build the SQL CLR dll and you do not need VS or VS Express edition. But the tools make develop the project easier with all the intellisense. The SQL CLR dll is nothing more than just a regular .NET assembly that is follow SQL CLR integration rules like

    using System;

    using System.Data;

    using Microsoft.SqlServer.Server;

    using System.Data.SqlTypes; // If you need to use sql data types

    //for function

    public partial class UserDefinedFunctions

    {

    public static SqlString fnHelloWorld()

    {

    return new SqlString("Hello World");

    }

    }

    -----------------------------

    Make sure your project output type is 'class library', a good book for reference is "Programming Microsoft SQL Server 2005 (Paperback)

    by Andrew J Brust, Stephen Forte" CLR chapter, I used VC# Express 2008 to do this, the VS Prof ed are just provide you a convenient SQL Project Template for developing/debugging/deploying and if you do not need that the dll build by express edition will be just fine except you need to do the deploying manually which isn't that difficult. The BOL CLR section is a good place to start, just follow the HelloWorld example.

  • I guess my question would be....

    ... what in blazes do you think you need to do in a database that can't be done in T-SQL?

    The only possible exception to that general statement is in the area of RegEx. Both Matt Miller and I have beat the daylights out of CLR v.s. T-SQL solutions and the only place where the CLR clearly won was where real RegEx code provided the obvious advantages over CharIndex, PatIndex, and LIKE.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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