如何:在存贮过程里使用Select 查询的返回结果?
如下:ALTER PROCEDURE byroyalty @percentage int
AS
select au_id,au_name from titleauthor
where
titleauthor.royaltyper = @percentage我想在这个过程里,
根据Select 查询的au_id及au_name内容,
再执行UpData,应该怎么办?
如下:ALTER PROCEDURE byroyalty @percentage int
AS
select au_id,au_name from titleauthor
where
titleauthor.royaltyper = @percentage我想在这个过程里,
根据Select 查询的au_id及au_name内容,
再执行UpData,应该怎么办?
AS
set nocount on
set ansi_warning off
select au_id,au_name from titleauthor
where
titleauthor.royaltyper = @percentagego
exec byroyalty 123
谢谢 新人类 !
我是刚学SQL的,盼能指点仔细点。先谢过了。
这两句是什么意思?
set nocount on
set ansi_warning off
这句就是执行另一些语句的块吗?
exec byroyalty 123
在这个块里,如果取得au_id的值?
根据Select 查询的au_id及au_name内容,
再执行UpData,应该怎么办?
==什么意思?
根据Select 查询的au_id及au_name内容,
再去修改au_id及au_name。
例如:
update titleauthor set au_id=4,au_name='aa'
where royaltyper = 3
update titleauthor set au_id=输入新值,au_name=输入新值
where 条件
select au_id,au_name from titleauthor where titleauthor.royaltyper = @percentage
这句后,我要取得au_id及au_name的值,如何办到?
AS
select au_id,au_name from titleauthor
where
titleauthor.royaltyper = @percentage
go
select * from openrowset
(
'sqloledb','.';'sa';'pwd','exec byroyalty 3'
)
http://community.csdn.net/Expert/topic/4615/4615911.xml?temp=.1720697
我的疑问已经解决了,希望能给你带来帮助!