Login    
 
 
 
 
Text/HTML
  
You are here :: Blogs Saturday, May 19, 2012

Search
Note: This uses the internal blog search engine. The Google search engine is also available at the top of the page.
  
Disclaimer

Please review the site disclaimer before downloading or using content found on this site

  
Categories
  
DEVSHED Blog
As always, I welcome your comments!
Dec 10

Written by: Steve Gray
12/10/2010 1:22 PM  RssIcon

This is part of the data access classes, look here for the overview

 

Code Snippet
  1. IF EXISTS (SELECT *
  2.     FROM   sysobjects
  3.     WHERE  name = N'f_4P_columnTypeVB')
  4. DROP FUNCTION f_4P_columnTypeVB
  5. GO
  6.  
  7. CREATE FUNCTION f_4P_columnTypeVB
  8. (@intColumnType as int)
  9. --select dbo.f_4P_columnTypeVB(104)
  10.  
  11. RETURNS varchar(30)
  12.  
  13. AS
  14. BEGIN
  15.     declare @out varchar(30)
  16.  
  17.     select @out =
  18.         case
  19.             when @intColumnType in(48) then 'Int16' /* tinyint  */
  20.             when @intColumnType in(52) then 'Int16' /* smallint  */
  21.             when @intColumnType in(56) then 'Int32' /* int  */
  22.             when @intColumnType in(127) then 'Int64' /* bigint  */
  23.             when @intColumnType = 104 then 'Boolean' /* bit */
  24.             when @intColumnType = 36 then 'GUID'
  25.             when @intColumnType in (108,60,63,106,62) then 'Double'
  26.             when @intColumnType in (104, 45) then 'Boolean'
  27.             when @intColumnType in (35,47,167, 175, 231,239) then 'String'
  28.             when @intColumnType = 61 then 'Date'
  29.             WHEN @intColumnType = 173 THEN 'Byte()' /* binary */
  30.             WHEN @intColumnType = 189 THEN 'Byte()' /* timestamp */
  31.             else 'Dunno - ' + convert(varchar(4),@intColumnType)
  32.             end
  33.     
  34.     return @out
  35.  
  36. END
  37. GO
  38. --sp_help sop10200

Tags:
Categories:
Location: Blogs Parent Separator DEVSHED Blogs Child Separator SQL
As always, I welcome your comments!
  
 
 
Home | Products | Blogs | Contact Us | Links | God's Plan
Privacy Statement | Terms Of Use
 
Copyright 2011 by Devshed.us