Sql Server 2005里面如何用C#写存储过程?
给段例子看看......

解决方案 »

  1.   

    体会SQL2005的CLR:用C#写存储过程SP http://www.cnblogs.com/steeven/archive/2004/08/04/30037.html
    http://mscenter.edu.cn/laputa/article/2005-4/0/13/11024.xml
      

  2.   

    参照楼上的第二个网址,我写了如下:
       [Microsoft.SqlServer.Server.SqlProcedure]
        public static void StoredProcedure2()
        {
            SqlCommand InsertCurrencyCommand =  SqlContext.GetCommand(); 
            InsertCurrencyCommand.CommandText = "select * from tablename)";
            InsertCurrencyCommand.ExecuteNonQuery();     }编译时报告:
    错误 1 “Microsoft.SqlServer.Server.SqlContext”并不包含“GetCommand”的定义 E:\我的文档\开发工程2005\SqlServerProject1\SqlServerProject1\StoredProcedure1.cs 32 56 SqlServerProject1