请高手帮忙: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 展开
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 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询