Created
March 29, 2018 12:44
-
-
Save gartha1/18776ffa33de808a4a2f6c10fa308a9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [Book] | |
GO | |
/****** Object: UserDefinedFunction [dbo].[ufnGetDetils] Script Date: 29/03/2018 1:43:52 PM ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
ALTER FUNCTION [dbo].[ufnGetDetils](@V NVARCHAR(100),@Morph NVARCHAR(100),@H NVARCHAR(100)) | |
RETURNS NVARCHAR(2000) | |
AS | |
-- Returns the stock level for the product. | |
BEGIN | |
DECLARE @value NVARCHAR(1000) | |
SELECT @value=COALESCE(@value+',','')+CONVERT(VARCHAR, [Root]+' '+Book+':'+CH) FROM dbo.BooksDetail | |
WHERE V=@V--'@vqp3ms+SxxxxJxCxAxExHaNxx' | |
AND Morph =@Morph-- 'Ha' | |
AND Cast(H AS Nvarchar(max))=@H--'ברא' | |
--SELECT @value | |
IF (@value IS NULL) | |
SET @value = ''; | |
RETURN @value; | |
END; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment