select @@VERSION
/*
Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86) 
Jul  9 2008 14:43:34 
Copyright (c) 1988-2008 Microsoft Corporation
Developer Edition on Windows NT 5.1 <X86> (Build 2600: Service Pack 3)
*/select length,name   from systypes order by length 
length name
------ ------------------------------------------- 
-1     geometry
-1     geography
-1     xml
1      tinyint
1      bit
2      smallint
3      date
4      int
4      smalldatetime
4      real
4      smallmoney
5      time
8      datetime2
8      money
8      datetime
8      float
8      bigint
8      timestamp
10     datetimeoffset
16     image
16     text
16     uniqueidentifier
16     ntext
17     decimal
17     numeric
256    sysname
892    hierarchyid
8000   nvarchar
8000   nchar
8000   varbinary
8000   varchar
8000   binary
8000   char
8016   sql_variant(34 row(s) affected)

解决方案 »

  1.   

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86) 
    Nov 24 2008 13:01:59 
    Copyright (c) 1988-2005 Microsoft Corporation
    Enterprise Evaluation Edition on Windows NT 5.1 (Build 2600: Service Pack 3)
    (1 行受影响)length name
    ------ --------------------------------------------------------------------------------------------------------------------------------
    -1     xml
    1      tinyint
    1      bit
    2      smallint
    4      int
    4      smalldatetime
    4      real
    4      smallmoney
    8      bigint
    8      money
    8      datetime
    8      float
    8      timestamp
    16     ntext
    16     image
    16     text
    16     uniqueidentifier
    17     decimal
    17     numeric
    256    sysname
    8000   nvarchar
    8000   nchar
    8000   varbinary
    8000   varchar
    8000   binary
    8000   char
    8016   sql_variant(27 行受影响)
      

  2.   


    select @@VERSION
    /*
    Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) 
    Oct 14 2005 00:33:37 
    Copyright (c) 1988-2005 Microsoft Corporation
    Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 3)
    */select length,name   from systypes order by length 
    /* 
    length name
    ------ --------------------------------------------------------------------------------------------------------------------------------
    -1     xml
    1      tinyint
    1      bit
    2      smallint
    4      int
    4      smalldatetime
    4      real
    4      smallmoney
    8      bigint
    8      money
    8      datetime
    8      float
    8      timestamp
    16     ntext
    16     image
    16     text
    16     uniqueidentifier
    17     decimal
    17     numeric
    256    sysname
    8000   nvarchar
    8000   nchar
    8000   varbinary
    8000   varchar
    8000   binary
    8000   char
    8016   sql_variant(27 row(s) affected)
    */
      

  3.   


    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86) 
    Nov 24 2008 13:01:59 
    Copyright (c) 1988-2005 Microsoft Corporation
    Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 3)
    (1 row(s) affected)length name
    ------ --------------------------------------------------------------------------------------------------------------------------------
    -1     xml
    1      tinyint
    1      bit
    2      smallint
    4      int
    4      smalldatetime
    4      real
    4      smallmoney
    8      bigint
    8      money
    8      datetime
    8      float
    8      timestamp
    16     ntext
    16     image
    16     text
    16     uniqueidentifier
    17     decimal
    17     numeric
    256    sysname
    8000   nvarchar
    8000   nchar
    8000   varbinary
    8000   varchar
    8000   binary
    8000   char
    8016   sql_variant(27 row(s) affected)
      

  4.   

    select @@VERSION
    /*
    Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (Intel X86)   
    Mar 29 2009 10:27:29   
    Copyright (c) 1988-2008 
    Microsoft Corporation  Enterprise Evaluation Edition on Windows NT 5.2 <X86> 
    (Build 3790: Service Pack 2) 
    */select length,name   from systypes order by length 
    /*
    -1 geometry
    -1 geography
    -1 xml
    1 tinyint
    1 bit
    2 smallint
    3 date
    4 int
    4 smalldatetime
    4 real
    4 smallmoney
    5 time
    8 datetime2
    8 money
    8 datetime
    8 float
    8 bigint
    8 timestamp
    10 datetimeoffset
    16 image
    16 text
    16 uniqueidentifier
    16 ntext
    17 decimal
    17 numeric
    256 sysname
    892 hierarchyid
    8000 nvarchar
    8000 nchar
    8000 varbinary
    8000 varchar
    8000 binary
    8000 char
    8016 sql_variant
    */
      

  5.   

    select @@VERSION
    /*
    (无列名)
    Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (Intel X86)   
    Mar 29 2009 10:27:29   
    Copyright (c) 1988-2008 Microsoft Corporation  
    Enterprise Edition on Windows NT 6.1 <X86> (Build 7600: ) 
    */
      

  6.   

    Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)   
    Oct 14 2005 00:33:37   
    Copyright (c) 1988-2005 Microsoft Corporation  
    Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 3) length name
    ------ ------------------
    -1     xml
    1      tinyint
    1      bit
    2      smallint
    4      int
    4      smalldatetime
    4      real
    4      smallmoney
    8      bigint
    8      money
    8      datetime
    8      float
    8      timestamp
    16     ntext
    16     image
    16     text
    16     uniqueidentifier
    17     decimal
    17     numeric
    256    sysname
    8000   nvarchar
    8000   nchar
    8000   varbinary
    8000   varchar
    8000   binary
    8000   char
    8016   sql_variant(27 行受影响)