请高手帮忙:SQL Sserver 2000数据库存储过程出现“列名 'object_id' 无效。”的错误,谢谢!

在sqlserver2000查询分析器中输入的脚本代码如下:SETANSI_NULLSONGOSETQUOTED_IDENTIFIERONGOIFNOTEXISTS(SE... 在sql server 2000查询分析器中输入的脚本代码如下:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[StoredProcedureIsFull]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[StoredProcedureIsFull]
(
@roomID char(4)
)
AS
Update Room Set IsFull=1 Where RoomID=@roomID
RETURN
'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[StoredProcedureAddClient]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[StoredProcedureAddClient]
(
@roomID char(4)

)
AS
Update Room Set FactPeopleNum=FactPeopleNum+1 Where RoomID=@roomID
RETURN
'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[StoredProcedureMinusClient]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[StoredProcedureMinusClient]
(
@roomID char(4)

)
AS
Update Room Set FactPeopleNum=FactPeopleNum-1 Where RoomID=@roomID
RETURN
'
END
展开
 我来答
阿饼1437
2015-04-30
知道答主
回答量:13
采纳率:0%
帮助的人:6.1万
展开全部
SQL2008后的版本才有'object_id'吧
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式