Friday, April 27, 2012

Function in SQL


USE [Surgere1]
GO
/****** Object:  UserDefinedFunction [dbo].[checkclassid]    Script Date: 04/27/2012 12:08:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[checkclassid] (@class_id bigint)
RETURNS @tblResult Table
(
class_id bigint
)
AS
BEGIN
if exists(select class_id from container where class_id=@class_id  )
Begin
Insert into @tblResult
select class_id from container where class_id=@class_id
End
if exists(select class_id from subclass where class_id=@class_id )
Begin
Insert into @tblResult
select class_id from subclass where class_id=@class_id
END


Return
END

No comments:

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...