roominfo_config_view.sql

来自「一个基本的酒店管理系统」· SQL 代码 · 共 42 行

SQL
42
字号
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'V' AND name = 'RoomInfo_config_view')
	BEGIN
		PRINT 'Dropping View RoomInfo_config_view'
		DROP  View RoomInfo_config_view
	END
GO

/******************************************************************************
**		File: 
**		Name: RoomInfo_config_view
**		Desc: 
**
**		This template can be customized:
**              
**
**		Auth: 
**		Date: 
*******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:				Description:
**		--------		--------				-------------------------------------------
**    
*******************************************************************************/

PRINT 'Creating View RoomInfo_config_view'
GO
CREATE View RoomInfo_config_view
as

select rid,(select ttype from typeroom where 
tid=rtid) as ttype,(select statetype from roomstate
where stateid=rstateid)as statetype,ingroup,roomtel,locknum,rtid from roominfo


GO


GRANT SELECT ON RoomInfo_config_view TO PUBLIC

GO

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?