CREATE FUNCTION [dbo].[GetCustomerTypeAsText] (@CustomerTypeNumber INT)
RETURNS Varchar(50) AS  
BEGIN 
  IF @CustomerTypeNumber = 1 RETURN 'Guest'
  IF @CustomerTypeNumber = 2 RETURN 'Company'
  IF @CustomerTypeNumber = 3 RETURN 'Guest'
  IF @CustomerTypeNumber = 4 RETURN 'Guest'
  IF @CustomerTypeNumber = 5 RETURN 'Guest'
  IF @CustomerTypeNumber = 6 RETURN 'Guest'
  IF @CustomerTypeNumber = 7 RETURN 'Guest'
  IF @CustomerTypeNumber = 8 RETURN 'Contact'
  Return 'Andet'
END

