0
我是這個新手,我不明白爲什麼我在執行此存儲過程時遇到錯誤。如果SQL Server 2008中的THEN子句
任何人都可以幫助我!
ALTER PROCEDURE [dbo].[Update_UserPassword]
(@username nvarchar(50),
@password nvarchar(20))
AS
BEGIN
DECLARE @flag bit
SET NOCOUNT ON;
SET @flag = (SELECT firstloginflag
FROM USER
WHERE username = @username)
-- Insert statements for procedure here
IF(@flag = 0)
UPDATE USER
SET firstloginflag = 1, password = @password
WHERE username = @username
ELSE
UPDATE USER
SET password = @password
WHERE username = @username
END
這是錯誤:
Msg 208, Level 16, State 6, Procedure Update_UserPassword, Line 31
Invalid object name 'dbo.Update_UserPassword'.
您可能已經在不同的架構中創建了此過程。這可能不是'dbo' –
不確定爲什麼你在標籤和問題標題中注意到'IF' /'THEN',因爲它似乎沒有任何關係 –
你應該在http: //dba.stackexchange.com/。 SO僅適用於**編程問題** – Liam