Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.syscolumns

  No additional text.


Syntax
CREATE VIEW sys.syscolumns AS
 SELECT name, id, xtype,
 typestat = convert(tinyint, status & 3),
 xusertype = convert(smallint, utype),
 length, xprec = prec,
 xscale = scale,
 colid = convert(smallint, colid),
 xoffset = convert(smallint, 0),
 bitpos = convert(tinyint, 0),
 reserved = convert(tinyint, 0),
 colstat = convert(smallint,
  (status & 4)/4
  + (status & 8)/4
  + (status & 16)/4
  + (status & 512)/128
  + (status & 1024)/32
  + (status & 0x20000)/32
  + (status & 0x40000)/32
  + (status & 0x80000)/32
  + (status & 0x100000)/32),
 cdefault = dflt,
 domain = chk,
 number = convert(smallint, case number when 1 then 1 - objectproperty(id, 'isscalarfunction') else number end),
 colorder = convert(smallint, colid),
 autoval = convert(varbinary(8000), null),
 offset  = convert(smallint, case number when 0 then columnproperty(id, name, 'sql65offset') else 0 end),
 collationid,
 language = case number when 0 then columnproperty(id, name, 'fulltextlcid') else 0 end,
 status = convert(tinyint,
  (1-(status & 1))*8
  + case when (status & 2 <> 0) or (xtype in (34, 35) and status & 0x20000 <> 0)
  then 16 else 0 end
  + case when (xtype in (34, 35) and status & 0x40000 <> 0) or (xtype in (173, 175, 189) and status & 1 = 0)
  then 32 else 0 end
  + (status & 512)/8
  + (status & 16)*4
  + (status & 4)*32),
 type = xtypetotds(xtype, 1 - (status & 1)),
 usertype = convert(smallint, columnproperty(id, name, 'oldusertype')),
 printfmt = convert(varchar(255), null),
 prec = convert(smallint,
  case when xtype in (34, 35, 99) then null
  when xtype = 36 then prec
  when length = -1 then -1
  else odbcprec(xtype, length, prec) end),
 scale = odbcscale(xtype, scale),
 iscomputed = convert(int, (status & 16)/16),
 isoutparam = convert(int, (status & 512)/512),
 isnullable = convert(int, 1 - (status & 1)),
 collation = convert(sysname, collationpropertyfromid(collationid, 'name')),
 tdscollation = convert(binary(5), collationpropertyfromid(collationid, 'tdscollation'))
 FROM sys.syscolpars
 WHERE has_access('CO', id) = 1
 UNION ALL
 SELECT name = name collate database_default,
 id, xtype,
 typestat = convert(tinyint, status & 3),
 xusertype = convert(smallint, utype),
 length, xprec = prec,
 xscale = scale,
 colid = convert(smallint, colid),
 xoffset = convert(smallint, 0),
 bitpos = convert(tinyint, 0),
 reserved = convert(tinyint, 0),
 colstat = convert(smallint, (status & 512)/128 + (status & 1024)/32),
 cdefault = sysconv(int, 0),
 domain = sysconv(int, 0),
 number = convert(smallint, case number when 1 then 1 - objectproperty(id, 'isscalarfunction') else number end),
 colorder = convert(smallint, colid),
 autoval = convert(varbinary(8000), null),
 offset  = convert(smallint, 0),
 collationid = cid,
 language = convert(int, 0),
 status = convert(tinyint, (status & 2 + 1 - (status & 1))*8 + (status & 512)/8),
 type = xtypetotds(xtype, 1 - (status & 1)),
 usertype = convert(smallint, columnproperty(id, name, 'oldusertype')),
 printfmt = convert(varchar(255), null),
 prec = convert(smallint,
  case when xtype in (34, 35, 99) then null
  when xtype = 36 then prec
  when length = -1 then -1
  else odbcprec(xtype, length, prec) end),
 scale = odbcscale(xtype, scale),
 iscomputed = convert(int, 0),
 isoutparam = convert(int, (status & 512)/512),
 isnullable = convert(int, 1 - (status & 1)),
 collation = convert(sysname, collationpropertyfromid(cid, 'name')),
 tdscollation = convert(binary(5), collationpropertyfromid(cid, 'tdscollation'))
 FROM sys.syscolrdb

 
Last revision 2008RTM
See also

  sp_bindrule (Procedure)
sp_IHget_colinfo (Procedure)
sp_IHscriptpkwhereclause (Procedure)
sp_IHscriptreconwhereclause (Procedure)
sp_IHscriptupdateparams (Procedure)
sp_MSareallcolpkcomputed (Procedure)
sp_MSbuild_single_post (Procedure)
sp_MSdependencies (Procedure)
sp_MSget_colinfo (Procedure)
sp_MShelpcolumns (Procedure)
sp_MShelpfulltextindex (Procedure)
sp_MSmatchkey (Procedure)
sp_MSmerge_altertable (Procedure)
sp_MSobjectprivs (Procedure)
sp_MSrepl_schema (Procedure)
sp_MStablekeys (Procedure)
sp_repldropcolumn (Procedure)
sp_scriptdelproccore (Procedure)
sp_scriptinsproccore (Procedure)
sp_scriptpkwhereclause (Procedure)
sp_scriptreconwhereclause (Procedure)
sp_scriptupdateparams (Procedure)
sp_scriptupdproccore (Procedure)
sp_vupgrade_mergetables (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash