日期:2014-05-17  浏览次数:21052 次

ASP中的sql语句中如何调用sql自定义函数?
比如:
VBScript code

CREATE FUNCTION dbo.f1(@re varchar(15))RETURNS bigint
AS
BEGIN
 ....
End
go

DECLARE @re VARCHAR(15);
SET @re='re_Value';
SELECT * FROM tb WHERE dbo.f1(id)>dbo.f1(@re);
Drop Function dbo.f1;



asp该如何调用它?

------解决方案--------------------
DECLARE @re VARCHAR(15);
SET @re='re_Value';
SELECT * FROM tb WHERE dbo.f1(id)>dbo.f1(@re);

按这几句写在 asp里的话可以是

re = "re_Value"

sql = "SELECT * FROM tb WHERE dbo.f1(id)>dbo.f1('"&re&"')"