1:
Create procedure Test @a varchar(10)
As ...
Select * from table where ...调用时 exec test ('adfd') 会返回一个 Select 语句
2: 可用函数
Create function test(@a varchar(10))
Returns table
As
return select * from table where ...
3:
可用##tmp,即全局临时表
Create procedure Test @a varchar(10)
As ...
Select * from table where ...调用时 exec test ('adfd') 会返回一个 Select 语句
2: 可用函数
Create function test(@a varchar(10))
Returns table
As
return select * from table where ...
3:
可用##tmp,即全局临时表
@a varchar(10)
As
Select * from table where col=@a
go