SQL Server 2005 supports CLR开发者_如何学Go so it means we can use CLR in backend so how to do that, I have some function in c# which do some complex manipulation with date-time variable now I want to use those functions in SP. First of all IS IT POSSIBLE TO DO THIS.
Yes, it is possible to use .NET in a SQL Server 2005 database. Be aware that the .NET version supported by SQL Server 2005 is 2.0.
Here's a link for an introduction to Making a CLR stored procedure using Visual Studio
Take a look this TSQL example
USE [XXX] GO SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER OFF GO CREATE PROCEDURE [dbo].[Testing_XXX]
@broadcastId [int],
@XXXTemplateHtml [nvarchar](max),
@XXXTemplateText [nvarchar](max),
@XXXTemplateSubject [nvarchar](max),
@XXXTemplateEmailHeaders [nvarchar](max),
@XXXTemplateHeader [nvarchar](max),
@XXXTemplateFooter [nvarchar](max),
@masterTemplate [nvarchar](max),
@parseOptions [nvarchar](4000),
@xsltTemplate [nvarchar](max) OUTPUT WITH EXECUTE AS CALLER AS EXTERNAL NAME  SolutionXXX.ProjectXXX].[StoredProcedures].[XXX_Parser_Parse] GO
When you call
EXTERNAL NAME [SolutionXXX.ProjectXXX].[StoredProcedures].[XXX_Parser_Parse]
It invokes a C# function looks like this
 [SqlProcedure]
public static void XXX_Parser_Parse(
    SqlInt32 broadcastId,
    [SqlFacet(MaxSize = -1)] 
    SqlString XXXTemplateHtml,
    [SqlFacet(MaxSize = -1)] 
    SqlString XXXTemplateText,
    [SqlFacet(MaxSize = -1)] 
    SqlString XXXTemplateSubject,
    [SqlFacet(MaxSize = -1)] 
    SqlString XXXTemplateEmailHeaders,
    [SqlFacet(MaxSize = -1)] 
    SqlString XXXTemplateHeader,
    [SqlFacet(MaxSize = -1)] 
    SqlString XXXTemplateFooter,
    [SqlFacet(MaxSize = -1)] 
    SqlString masterTemplate,
    SqlString parseOptions,
    [SqlFacet(MaxSize = -1)] 
    out SqlString xsltTemplate)
{
//blah blah blh
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论