SQL Server抛出“无效对象名称”错误

时间:2012-03-04 05:47:23

标签: sql-server stored-procedures

我编写了以下存储过程:

ALTER PROCEDURE [dbo].[spLinkAssetToModule]
(   -- Add the parameters for the stored procedure here 
@Module_ID int,
@Asset_ID int
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

Insert Into [dbo].[Modules_Assets_Link] (Modules_ID, Assets_ID, DateCreated) 
VALUES (@Module_ID, @Asset_ID, GETDATE());

END

当我点击“保存”时,它给了我“无效的对象名称'dbo.spLinkAssetToModule'”错误。有谁知道原因?它与访问权限有关吗?

1 个答案:

答案 0 :(得分:2)

使用CREATE PROCEDURE创建存储过程,而不是ALTER PROCEDURE