logo search
Разработка CRM-системы библиотек

3.4.2 Текст процедуры на языке SQL-запросов

USE [BD Library]

GO

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE PROCEDURE Procedure2

@KODEBOOK int

AS

BEGIN

SET NOCOUNT ON;

SELECT dbo.Subscription.date_issue, dbo.Subscription.date_return, dbo.Subscription.advance

from dbo.Subscription

where dbo.Subscription.idbook=@KODEBOOK

SELECT dbo.Books.idbook, dbo.Books.author, dbo.Books.name

FROM dbo.Books

WHERE dbo.Books.idbook=@KODEBOOK

END

USE [BD Library]

GO

DECLARE@return_value int

EXEC@return_value = dbo.Procedure2

@KODEBOOK = 3

SELECTReturn Value = @return_value