大家好,我已经写了这个存储过程,但是里面有一个错误,上面写着
无法在 nvarchar 上调用方法
T-SQL 代码:
ALTER PROCEDURE dbo.User_Announcement_Create
@Announcement nvarchar(250),
@UserName nvarchar(256)
AS
BEGIN
DECLARE @NewAnnouncement nvarchar(250)
SELECT @NewAnnouncement = NULL
IF( @UserName.dbo.Announcements IS NULL )
( SELECT UserName FROM dbo.aspnet_Users
WHERE @UserName = UserName )
RETURN -1
END
DECLARE @CreateAnnouncement bit
DECLARE @ReturnValue int
SET @ReturnValue = 0
SELECT @NewAnnouncement = Announcement FROM Announcements
SET @CreateAnnouncement = 1
INSERT INTO Announcements (Announcement, UserName)
VALUES (@Announcement, @UserName)
谁能帮我解决这个问题?