Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MSSQLÌí¼Ó×Ö¶Î˵Ã÷

--×Ö¶ÎÌí¼Ó˵Ã÷
EXEC sp_addextendedproperty 'MS_Description', 'ÒªÌí¼ÓµÄ˵Ã÷', 'user', dbo, 'table', ±íÃû, 'column', ÁÐÃû
--ɾ³ý×Ö¶Î˵Ã÷
EXEC sp_dropextendedproperty 'MS_Description', 'user', dbo, 'table', ±íÃû, 'column', ×Ö¶ÎÃû
--²é¿´×Ö¶Î˵Ã÷
SELECT
    [Table Name] = i_s.TABLE_NAME,
    [Column Name] = i_s.COLUMN_NAME,
    [Description] = s.value
from
    INFORMATION_SCHEMA.COLUMNS i_s
LEFT OUTER JOIN
    sysproperties s
ON
    s.id = OBJECT_ID(i_s.TABLE_SCHEMA+'.'+i_s.TABLE_NAME)
    AND s.smallid = i_s.ORDINAL_POSITION
    AND s.name = 'MS_Description'
WHERE
    OBJECTPROPERTY(OBJECT_ID(i_s.TABLE_SCHEMA+'.'+i_s.TABLE_NAME), 'IsMsShipped')=0
     AND i_s.TABLE_NAME = 'jobs'
ORDER BY
    i_s.TABLE_NAME, i_s.ORDINAL_POSITION


Ïà¹ØÎĵµ£º

Ö÷Á÷Êý¾Ý¿âMYSQL/MSSQL/ORACLE²âÊÔÊý¾Ý¿â½Å±¾´úÂë


/******************************************************************************/
/*
Ö÷Á÷Êý¾Ý¿âMYSQL/MSSQL/ORACLE²âÊÔÊý¾Ý¿â½Å±¾´úÂë
½Å±¾ÈÎÎñ:½¨Á¢4¸ö±í,Ìí¼ÓÖ÷¼ü,Íâ¼ü£¬²åÈëÊý¾Ý,½¨Á¢ÊÓͼ
ÔËÐл·¾³1:microsoft sqlserver 2000 ²éѯ·ÖÎöÆ÷
ÔËÐл·¾³2:mysql5.0 phpMyAdminÍøÒ³½çÃæ
ÔËÐл·¾³3:oracle 9i SQL*P ......

»ùÓÚmssql °ÙÍò¼¶ Êý¾Ý ²éѯ ÓÅ»¯ ¼¼ÇÉÈýÊ®Ôò

1.¶Ô²éѯ½øÐÐÓÅ»¯£¬Ó¦¾¡Á¿±ÜÃâÈ«±íɨÃ裬Ê×ÏÈÓ¦¿¼ÂÇÔÚ where ¼° order by Éæ¼°µÄÁÐÉϽ¨Á¢Ë÷Òý¡£
2.Ó¦¾¡Á¿±ÜÃâÔÚ where ×Ó¾äÖжÔ×ֶνøÐÐ null ÖµÅжϣ¬·ñÔò½«µ¼ÖÂÒýÇæ·ÅÆúʹÓÃË÷Òý¶ø½øÐÐÈ«±íɨÃ裬È磺
select id from t where num is null
¿ÉÒÔÔÚnumÉÏÉèÖÃĬÈÏÖµ0£¬È·±£±íÖÐnumÁÐûÓÐnullÖµ£¬È»ºóÕâÑù²éѯ£º
select id ......

MSSQLÊý¾Ý¿â±¸·Ý

1
¡¢
MSSQL
Êý¾Ý¿âµÄ¶¨ÆÚ×Ô¶¯±¸·Ý¼Æ»®
 
ͨ¹ýÆóÒµ¹ÜÀíÆ÷
ÉèÖÃÊý¾Ý¿âµÄ¶¨ÆÚ×Ô¶¯±¸·Ý¼Æ»®¡£
1
¡¢´ò¿ªÆóÒµ¹Ü
ÀíÆ÷£¬Ë«»÷´ò¿ªÄãµÄ·þÎñÆ÷
2
¡¢È»ºóµãÉÏÃæ
²Ëµ¥ÖеŤ¾ß
-->
Ñ¡ÔñÊý¾Ý¿âά»¤¼Æ»®Æ÷
3
¡¢ÏÂÒ»²½Ñ¡ÔñÒª½øÐÐ×Ô¶¯±¸·ÝµÄÊý¾Ý
-->
ÏÂÒ»²½¸üÐÂÊý¾ÝÓÅ»¯ÐÅÏ¢£¬ÕâÀïÒ»°ã²»ÓÃ×öÑ¡Ôñ
-->
ÏÂÒ ......

½²½âMSSQLÊý¾Ý¿âÖÐSQLËø»úÖƺÍÊÂÎñ¸ôÀ뼶±ð

Ëø»úÖÆ
NOLOCKºÍREADPASTµÄÇø±ð¡£
1. ¿ªÆôÒ»¸öÊÂÎñÖ´ÐвåÈëÊý¾ÝµÄ²Ù×÷¡£
BEGIN TRAN t
INSERT INTO Customer
SELECT 'a','a'
2. Ö´ÐÐÒ»Ìõ²éѯÓï¾ä¡£
SELECT * from Customer WITH (NOLOCK)
½á¹ûÖÐÏÔʾ"a"ºÍ"a"¡£µ±1ÖÐÊÂÎñ»Ø¹öºó£¬ÄÇôa½«³ÉΪÔàÊý¾Ý¡£(×¢:1ÖеÄÊÂÎñδÌá½») ¡£NOLOCK±íÃ÷ûÓжÔÊý¾Ý±íÌí¼Ó¹²Ï ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ