ALTER PROCEDURE ProcDeleteUser
@userID int
AS
/* SET NOCOUNT ON */
update Projects set UserID=null where UserID = @userID
delete from User where UserID =@userID
RETURN
保存时提示User附近有错误!据说在在表名前加上架构名可行,[架构名].[表名]这架构名是什么呢?
把User用中括号括起来
ALTER PROCEDURE [dbo].[ProcDeleteUser]
@userID int
as
BEGIN
update Projects set UserID=null where UserID = @userID
delete from [User] where UserID =@userID
RETURN
END
定义与关键字相同的标识时用[]包起来