Create Function GetName @ID int
Returns VARCHAR(100)
AS
Select
Case cSpouseName
When Null Then cFirstName + ' ' + cLastName
Else
Case cSpouseLastName
When Null Then cFirstName + ' & ' + cSpouseName + ' ' + cLastName
Else cFirstName + ' ' + cLastName
End
End
FROM Client
Where cClient = @ID
|