日期:2014-05-17 浏览次数:20457 次
CREATE PROCEDURE [dbo].[Proc_UserPaperList] AS SELECT distinct [dbo].[Users].[UserID], [dbo].[Users].[UserName], [dbo].[Users].[DepartmentId], [dbo].[Department].[DepartmentId], [dbo].[Department].[DepartmentName], [dbo].[UserAnswer].[UserID], [dbo].[UserAnswer].[PaperID], [dbo].[UserAnswer].[ExamTime], [dbo].[Paper].[PaperName], [dbo].[Paper].[PaperState] as state FROM [dbo].[Users],[dbo].[Department],[dbo].[UserAnswer],[dbo].[Paper] where Users.DepartmentId=Department.DepartmentId and Users.UserID=UserAnswer.UserID and UserAnswer.PaperID=Paper.PaperID GO
create procedure p_delete (@userid nvarchar(50), @paperid nvarchar(50) ) as begin delete from user where userid=@userid ; delete from paper where paperid=@paperid; end