And open basis using the SQLCLR

Summary
SQLCLR I do not quite understand. Will not say
here I use VS TOOLS to develop one for entry

In use when you need to understand some of his SQLCLR configuration he has a little lightweight pooling advanced settings associated with
him does not support sqlclr,

We are to learn to worry about.
Open clr it does not support this UI sql statement is as follows

EXEC sp_configure "clr enabled" ,1
go
RECONFIGURE

The value is close to 0

Clr start building applications

1. 打开 VS  ---> 视图 ---> Sql server 对象资源管理器 ;
2. 连接一个sql 服务器实例
3. 现在一个数据,右键 ---> 创建新项目
4. 在打开配置页面中配置信息 -->启动
5. 解决方案对象资源管理器 选择项目右键---> 添加新项 -->选择 Sqlclr C# 存储过程
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;

public partial class StoredProcedures
{
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void SqlStoredProcedure1 (out string text)
    {
        // 在此处放置代码
        SqlContext.Pipe.Send("Hello Suhe" + Environment.NewLine);
        text = "我的第一个SqlClr程序集";
    }
}

修改代码

6. 项目右键--->发布 配置目标数据库连接及数据库 发布  1-2 两分钟
7. 选择发布数据 存款过程 点击 可编程性 -->存储课程

Right ---> execute a stored procedure OK? And open basis using the SQLCLR

Guess you like

Origin blog.51cto.com/3478586/2472059