我感觉很疯狂,我决定我真的想用Python编写一个可以在SQL Server2008中运行的用户定义函数。我对此很感兴趣,因为我有几千行为PostgreSQL编写的PL/Python函数,我想知道是否可以在SQL Server上运行该项目。
我第一次看着IronPython,想知道我是否可以转换成像这样的C#……
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial class UserDefinedFunctions
{
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString Function1()
{
// Put your code here
return new SqlString("Hello");
}
};..。变成了Python。
有没有人对这个有什么想法?有可能吗?
让我特别困惑的是注释:
Microsoft.SqlServer.Server.SqlFunction
我该怎么用Python来写呢?看起来有点像装饰器:)
欢迎所有建议。
干杯,汤姆
发布于 2010-08-17 23:21:18
根据this article的说法,你是在浪费时间。显然,即使在不安全的程序集中,也不能在SQL中使用动态语言。
https://stackoverflow.com/questions/3503996
复制相似问题