我是创建存储过程。执行时没有错误但没有返回任何值,请给我建议 [英] i was create stored procedure. that was executed with out error but does not return any value please give me advice
本文介绍了我是创建存储过程。执行时没有错误但没有返回任何值,请给我建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<pre>-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE Tms_User_Login
-- Add the parameters for the stored procedure here
@ntlg varchar(50)
---<@Param2, sysname, @p2> <Datatype_For_Param2, , int> = <Default_Value_For_Param2, , 0>
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
select PROCESS_NAME FROM TF_PROCESS_MASTER WHERE PROCESS_ID=(select PROCESS_ID FROM TF_PROJECT_MASTER WHERE PROJECT_ID=(select PROJECT_ID FROM TF_ASSOCIATE_LEVEL WHERE SYSTEM_LOGIN_ID='@ntlg' ))
END
GO
推荐答案
这里你没有使用@ntlg
作为参数,而不是像字符串一样使用它。所以,删除单引号并尝试如下...
Here you have not used the@ntlg
as a parameter, rather you have used it like a string. So, remove the single quotes and try like below...
SELECT PROCESS_NAME
FROM TF_PROCESS_MASTER
WHERE PROCESS_ID = (SELECT PROCESS_ID
FROM TF_PROJECT_MASTER
WHERE PROJECT_ID = (SELECT PROJECT_ID
FROM TF_ASSOCIATE_LEVEL
WHERE SYSTEM_LOGIN_ID = @ntlg)
)
这篇关于我是创建存储过程。执行时没有错误但没有返回任何值,请给我建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文