高手帮忙看看
if exists(select name from sysobjects where name='ss'and type='p') drop procedure ss go
create procedure ss @cname1 varchar(20)output , @cno1 char(2)
as select @cname1,@cno1 from course
go
declare @cname1 varchar(20), @cno1 char(2) select @cname1='数据库' , @cno1='2' exec ss @cname1 , @cno1 select 'kk '+convert (nvarchar,@cname1) go
为何显示的结果是和FROM 后表一样多的行,怎么才能显示一行,因为每行都一样
if exists(select name from sysobjects where name='ss'and type='p') drop procedure ss go
create procedure ss @cname1 varchar(20) as select A.sno ,B.cno,B.cname,C.grade from student as A inner join SC as C on A.sno=C.sno inner join Course as B on C.cno=B.cno where B.cname= @cname1
go
exec ss '微积分' 为何变量不能声明两个,而且其中的一个变量在什么地方声明的也不清楚,请高手指教