在SQLSERVER创建存储过程时发现SQLSERVER2008R2支持的.net版本是3.5
Open Microsoft Visual Studio >> Click New Project >> Select Visual C# >> Database >> SQL Server Project
在VS2010中创建了SQL SERVER工程
public partial class StoredProcedures{ [Microsoft.SqlServer.Server.SqlProcedure] public static void StoredProcedureMail() { // 在此处放置代码 SqlPipe sp; sp = SqlContext.Pipe; String strCurrentTime = "Current System DateTime is: " + System.DateTime.Now.ToString(); sp.Send(strCurrentTime); }};
CREATE ASSEMBLY MyMailMan from 'D:\NetPro\SqlServerProjectForMyMailMan.dll' WITH PERMISSION_SET = SAFE