CREATE PROCEDURE [dbo].[Proc_PaperUseList]
(@paperState [Int])
AS SELECT [dbo].[Paper].[PaperID],
[dbo].[Paper].[PaperName]
FROM [dbo].[Paper],[dbo].[Course]
where PaperState=@paperState And [dbo].[Paper].[CourseID]=[dbo].[Course].[ID]
GO
------------------------------------------------------------------
在执行exec Proc_PaperUseList 3 的时候不能过显示查询结果。直接执行SELECT [dbo].[Paper].[PaperID],
[dbo].[Paper].[PaperName]
FROM [dbo].[Paper],[dbo].[Course]
where PaperState='3' And [dbo].[Paper].[CourseID]=[dbo].[Course].[ID]
是有结果的.
(@paperState [Int])
AS SELECT [dbo].[Paper].[PaperID],
[dbo].[Paper].[PaperName]
FROM [dbo].[Paper],[dbo].[Course]
where PaperState=@paperState And [dbo].[Paper].[CourseID]=[dbo].[Course].[ID]
GO
------------------------------------------------------------------
在执行exec Proc_PaperUseList 3 的时候不能过显示查询结果。直接执行SELECT [dbo].[Paper].[PaperID],
[dbo].[Paper].[PaperName]
FROM [dbo].[Paper],[dbo].[Course]
where PaperState='3' And [dbo].[Paper].[CourseID]=[dbo].[Course].[ID]
是有结果的.
AS
SELECT [dbo].[Paper].[PaperID],
[dbo].[Paper].[PaperName]
FROM [dbo].[Paper],[dbo].[Course]
where PaperState=@paperState And [dbo].[Paper].[CourseID]=[dbo].[Course].[ID]
GO
(@paperState [Int])
AS SELECT [dbo].[Paper].[PaperID],
[dbo].[Paper].[PaperName]
FROM [dbo].[Paper],[dbo].[Course]
where LTRIM(RTRIM(PaperState))=RTRIM(@paperState) And [dbo].[Paper].[CourseID]=[dbo].[Course].[ID]
GO