Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kiranmurali
Yak Posting Veteran
55 Posts |
Posted - 2010-07-14 : 01:58:25
|
| how to use if then else condition in function in SQL SERVER 2008?pls give some sample examples.thanks in advanceKiran |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-07-14 : 02:12:40
|
no diff from using it in stored procedurecreate function fn_test( @val int)returns varchar(10)asbegin declare @result varchar(10) if @val = 1 begin select @result = 'TRUE' end else begin select @result = 'FALSE' end return @resultendgoselect dbo.fn_test(1), dbo.fn_test(2) KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|