|
|
|
This sample shows several ways to call a scalar function in T-SQL. |
Click here to copy the following block | use pubs go create function test ( @ci char( 1 ) ) returns bit as begin return( CASE WHEN NULLIF( @ci , space( 1) ) is not null then 0 else 1 end ) end go
declare @ci char( 1 ) , @y bit set @ci =' '
exec @y = test @ci select @y as IsBlank
set @ci ='A'
set @y = dbo.test( @ci ) select @y as IsBlank
set @ci ='b'
select @y = dbo.test( @ci ) select @y as IsBlank
set @ci ='V'
set @y = fn_chariswhitespace( @ci ) select @y as IsBlank
|
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|