sys.columns £¨SQL Server 2005 £©
Ϊ°üº¬ÁеĶÔÏó£¨ÈçÊÓͼ»ò±í£©µÄÿÁзµ»ØÒ»ÐС£ÏÂÃæÊǰüº¬ÁеĶÔÏóÀàÐ͵ÄÁÐ±í¡£
±íÖµ³ÌÐò¼¯º¯Êý (FT)
ÄÚÁª±íÖµ SQL º¯Êý (IF)
ÄÚ²¿±í (IT)
ϵͳ±í (S)
±íÖµ SQL º¯Êý (TF)
Óû§±í (U)
ÊÓͼ (V)
ÁÐÃû Êý¾ÝÀàÐÍ ËµÃ÷
object_id
int
´ËÁÐËùÊô¶ÔÏóµÄ ID¡£
name
sysname
ÁÐÃû¡£ÔÚ¶ÔÏóÖÐÊÇΨһµÄ¡£
column_id
int
ÁÐµÄ ID¡£ÔÚ¶ÔÏóÖÐÊÇΨһµÄ¡£
×¢Ò⣺
ÁÐ ID ²»Äܰ´Ë³ÐòÅÅÁС£
system_type_id
tinyint
ÁеÄϵͳÀàÐ굀 ID¡£
user_type_id
int
ÁеÄÀàÐ굀 ID£¬ÓÉÓû§¶¨Òå¡£
max_length
smallint
ÁеÄ×î´ó³¤¶È£¨×Ö½Ú£©¡£
-1 = ÁÐÊý¾ÝÀàÐÍΪ varchar(max)¡¢nvarchar(max)¡¢varbinary(max) »ò xml¡£
¶ÔÓÚ text ÁУ¬max_length ֵΪ 16 »òÊÇÓÉ sp_tableoption 'text in row' ÉèÖõÄÖµ¡£
precision
tinyint
Èç¹ûÁаüº¬µÄÊÇÊýÖµ£¬ÔòΪ¸ÃÁеľ«¶È£»·ñÔòΪ 0¡£
scale
tinyint
Èç¹û»ùÓÚÊýÖµ£¬ÔòΪÁеÄСÊýλÊý£»·ñÔòΪ 0¡£
collation_name
sysname
Èç¹ûÁаüº¬µÄÊÇ×Ö·û£¬ÔòΪ¸ÃÁÐÅÅÐò¹æÔòµÄÃû³Æ£»·ñÔòΪ NULL¡£
is_nullable
bit
1 = ÁпÉΪ¿Õ¡£
is_ansi_padded
bit
1 = Èç¹ûÁÐΪ×Ö·û¡¢¶þ½øÖÆ»ò±äÁ¿ÀàÐÍ£¬Ôò¸ÃÁÐʹÓà ANSI_PADDING ON ÐÐΪ¡£
0 = Áв»ÊÇ×Ö·û¡¢¶þ½øÖÆ»ò±äÁ¿¡£
is_rowguidcol
bit
1 = ÁÐΪÉùÃ÷µÄ ROWGUIDCOL¡£
is_identity
bit
1 = ÁоßÓбêʶֵ¡£
is_computed
bit
1 = ÁÐΪ¼ÆËãÁС£
is_filestream
bit
±£Áô¹©ÒÔºóʹÓá£
is_replicated
bit
1 = ÁÐÒѸ´ÖÆ¡£
is_non_sql_subscribed
bit
1 = ÁоßÓÐ·Ç SQL Server ¶©ÔÄ·þÎñÆ÷¡£
is_merge_published
bit
1 = ÁÐÒѺϲ¢·¢²¼¡£
is_dts_replicated
bit
1 = ʹÓà SQL Server 2005 Integration Services (SSIS) ¸´ÖÆÁС£
is_xml_document
bit
1 = ÄÚÈÝΪÍêÕûµÄ XML Îĵµ¡£
0 = ÄÚÈÝÊÇÎĵµÆ¬¶Î»òÁÐÊý¾ÝÀàÐͲ»ÊÇ xml¡£
xml_collection_id
int
Èç¹ûÁÐÊÇ xml ÇÒÒѼüÈë XML£¬ÔòΪ·ÇÁã¡£¸ÃÖµ½«Îª°üº¬ÁеÄÑéÖ¤ XML ¼Ü¹¹ÃüÃû¿Õ¼äµÄ¼¯ºÏµÄ ID¡£
0 = ûÓÐ XML ¼Ü¹¹¼¯ºÏ¡£
default_object_id
int
ĬÈ϶ÔÏóµÄ ID£¬ÎÞÂÛËüÊǶÀÁ¢¶ÔÏó sys.sp_bindefault »¹ÊÇÄÚÁªÁм¶ DEFAULT Ô¼Êø¡£ÄÚÁªÁм¶Ä¬È϶ÔÏóµÄ parent_object_id ÁÐÊÇ¶Ô¸Ã±í±¾ÉíµÄ·´ÒýÓá£
0 = ÎÞĬÈÏÖµ¡£
rule_object_id
int
ʹÓà sys.sp_bindrule °ó¶¨µ½ÁеĶÀÁ¢¹æÔòµÄ ID¡£
0 = ÎÞ¶ÀÁ¢¹æÔò¡£ÓйØÁм¶ CHECK Ô¼ÊøµÄÐÅÏ¢£¬Çë²ÎÔÄ sys.check_constraints
Ïà¹ØÎĵµ£º
н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default \'ĬÈÏÖµ\' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [ ......
¡¾×ª¡¿Ò»Ð©³£ÓõÄsqlÓï¾ä×Ö·û´®´¦Àí£¬×ªÓÚÕâÀÒÔ·½±ãʹÓÃ
Ò»¡¢×Ö·ûת»»º¯Êý
1¡¢ASCII()
·µ»Ø×Ö·û±í´ïʽ×î×ó¶Ë×Ö·ûµÄASCII ÂëÖµ¡£ÔÚASCII£¨£©º¯ÊýÖУ¬´¿Êý×ÖµÄ×Ö·û´®¿É²»ÓÑ’À¨ÆðÀ´£¬µ«º¬ÆäËü×Ö·ûµÄ×Ö·û´®±ØÐëÓÑ’À¨ÆðÀ´Ê¹Ó㬷ñÔò»á³ö´í¡£
2¡¢CHAR()
½«ASCII Âëת»»Îª×Ö·û¡£Èç¹ûûÓÐÊäÈë0 ~ ......
¢Ù¡£Æô¶¯Distributed Transaction Coordinator ·þÎñ
´ò¿ª·þÎñ£¬ÔÚ·þÎñÖÐÕÒµ½Distributed Transaction Coordinator·þÎñ£¬Ñ¡Ôñ“ÊôÐÔ”£»
ÔÚ“µÇ¼”Ñ¡ÏÖУ¬Ñ¡Ôñ“´ËÕÊ»§”£¬ÕÊ»§ÃûÌîд“N ......
ÔÚSQL½á¹¹»¯²éѯÓïÑÔÖУ¬LIKEÓï¾äÓÐ×ÅÖÁ¹ØÖØÒªµÄ×÷Óá£
¡¡¡¡LIKEÓï¾äµÄÓï·¨¸ñʽÊÇ£ºselect * from ±íÃû where ×Ö¶ÎÃû like ¶ÔÓ¦Öµ£¨×Ó´®£©£¬ËüÖ÷ÒªÊÇÕë¶Ô×Ö·ûÐÍ×ֶεģ¬ËüµÄ×÷ÓÃÊÇÔÚÒ»¸ö×Ö·ûÐÍ×Ö¶ÎÁÐÖмìË÷°üº¬¶ÔÓ¦×Ó´®µÄ¡£
¡¡¡¡¼ÙÉèÓÐÒ»¸öÊý¾Ý¿âÖÐÓиö±ítable1£¬ÔÚtable1ÖÐÓÐÁ½¸ö×ֶΣ¬·Ö±ðÊÇnameºÍsex¶þÕßÈ«ÊÇ×Ö·ûÐÍÊý¾ ......