日期:2014-05-17 浏览次数:20439 次
CREATE PROCEDURE 存储过程名
@变量1 nvarchar(40),
@变量2 nvarchar(20),
@变量3 nvarchar(20),
@变量4 nvarchar(6),
@变量5 nvarchar(6)
AS
BEGIN
select 新字段1,新字段2,新字段3
form (
select
11 as 新字段1
, 12 as 新字段2
, 13 as 新字段3
from 表1
union all select
21 as 新字段1
, 22 as 新字段2
, 23 as 新字段3
from 表2
) as tmp
END
CREATE PROCEDURE 存储过程名
@变量1 nvarchar(40),
@变量2 nvarchar(20),
@变量3 nvarchar(20),
@变量4 nvarchar(6),
@变量5 nvarchar(6)
AS
BEGIN
select 新字段1,新字段2,新字段3
from (
select
11 as 新字段1
, 12 as 新字段2
, 13 as 新字段3
from 表1
union all select
21 as 新字段1
, 22 as 新字段2
, 23 as 新字段3
from 表2
) as tmp
END