drop table table1 go create table table1 (a1 nvarchar(10),a2 nvarchar(10),a3 real) go insert into table1 select '11111','aaaaa',5235632.2 insert into table1 select '22222','bbbbb',545.2 insert into table1 select '33333','ccccc',255325.1 insert into table1 select '44444','ddddd',532532.4343 go create function f1 (@a nvarchar(10),@b nvarchar(10)) returns table as return(select a1,a2 from table1 where a1 = @a or a2 = @b) go create proc p2 (@a nvarchar(10),@b nvarchar(10)) as select * from f1(@a,@b) go exec p2 '11111' ,'bbbbb' godrop table table1 drop function f1 drop proc p2
go
create table table1 (a1 nvarchar(10),a2 nvarchar(10),a3 real)
go
insert into table1 select '11111','aaaaa',5235632.2
insert into table1 select '22222','bbbbb',545.2
insert into table1 select '33333','ccccc',255325.1
insert into table1 select '44444','ddddd',532532.4343
go
create function f1 (@a nvarchar(10),@b nvarchar(10))
returns table
as
return(select a1,a2 from table1 where a1 = @a or a2 = @b)
go
create proc p2 (@a nvarchar(10),@b nvarchar(10))
as
select * from f1(@a,@b)
go
exec p2 '11111' ,'bbbbb'
godrop table table1
drop function f1
drop proc p2
不是通过ado.net调用存储过程,然后存储过程再调用函数。你只说.net能调存储过程,没说.net能不能掉函数啊,而且调用方式是否相同?