stored procedures.sql

来自「VB6数据库开发指南》的配套源程序」· SQL 代码 · 共 47 行

SQL
47
字号
if exists (select * from sysobjects where id = object_id('dbo.GetAuthorTitleList') and sysstat & 0xf = 4)
	drop procedure dbo.GetAuthorTitleList
GO

CREATE PROCEDURE GetAuthorTitleList
AS
select a.au_lname, a.au_fname, t.title
	from authors a
	, titleauthor ta
	, titles t
	where a.au_id = ta.au_id
	and ta.title_id = t.title_id
	order by a.au_lname, a.au_fname


GO

GRANT  EXECUTE  ON dbo.GetAuthorTitleList  TO public
GO

GRANT  EXECUTE  ON dbo.GetAuthorTitleList  TO guest
GO

if exists (select * from sysobjects where id = object_id('dbo.GetTitleAuthorList') and sysstat & 0xf = 4)
	drop procedure dbo.GetTitleAuthorList
GO

CREATE PROCEDURE GetTitleAuthorList
AS
select a.au_lname, a.au_fname, t.title
	from authors a
	, titleauthor ta
	, titles t
	where a.au_id = ta.au_id
	and ta.title_id = t.title_id
	order by t.title


GO

GRANT  EXECUTE  ON dbo.GetTitleAuthorList  TO public
GO

GRANT  EXECUTE  ON dbo.GetTitleAuthorList  TO guest
GO

⌨️ 快捷键说明

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