This is a helper function used in DDL scripts
-- =============================================
-- v 1.5
-- =============================================
IF EXISTS (SELECT *
FROM sysobjects
WHERE name = N'f_4P_columnTypeVB')
DROP FUNCTION f_4P_columnTypeVB
GO
CREATE FUNCTION f_4P_columnTypeVB
(@intColumnType as int)
-- select dbo.f_4P_columnTypeVB(56)
RETURNS varchar(20)
AS
BEGIN
declare @out varchar(20)
select @out =
case when @intColumnType in(48,52, 56) then 'system.int64'
when @intColumnType = 36 then 'GUID'
when @intColumnType in(108,60,63,106) then 'double'
when @intColumnType = 45 then 'boolean'
when @intColumnType in (35,47,167, 175,231) then 'string'
when @intColumnType = 61 then 'date'
when @intColumnType = 104 then 'int16' --bit
--when @intColumnType = 173 then 'binary(' + convert(varchar(4),@intLength) + ')'
else 'dunno - ' + convert(varchar(4),@intColumnType)
end
return @out
END
GO