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

SQL ServerµÄϵͳ±í¼°ÆäÓ¦ÓÃÑо¿


¡¡¡¡1. SQL ServerµÄϵͳ±í
¡¡¡¡MicrosoftµÄSQL ServerÊÇÒ»¸ö¿ÉÉìËõµÄ¸ßÐÔÄÜÊý¾Ý¿â¹ÜÀíϵͳ£¬×¨Îª·Ö²¼Ê½¿Í»§»ú/·þ
ÎñÆ÷»·¾³¶øÉè¼Æ£¬SQL Server¼¸ºõ½«ËùÓеÄÅäÖÃÐÅÏ¢¡¢°²È«ÐÔÐÅÏ¢ºÍ¶ÔÏóÐÅÏ¢¶¼´æ´¢ÔÚÁËËü×Ô
ÉíµÄϵͳ±íÖУ¬¶øϵͳ±í´æÔÚÓÚÿ¸ö¶ÀÁ¢µÄÊý¾Ý¿âÖУ¬´æ´¢Ò»¸öÌض¨Êý¾Ý¿â¶ÔÏóÐÅÏ¢µÄϵͳ±í
ͨ³£³ÆΪÊý¾Ý¿âĿ¼£¬MASTERÊý¾Ý¿âÓÐÆäÌØÓеÄϵͳ±íÓÃÓÚ±£´æÕû¸öϵͳºÍËùÓÐÊý¾Ý¿âµÄÐÅÏ¢
£¬Í¨³£³ÆΪ·þÎñÆ÷Ŀ¼»òϵͳĿ¼¡£ 
·þÎñÆ÷ÉÏËùÓеÄÊý¾Ý¿â°üÀ¨MODULE£¬ MASTERµÈ¶¼º¬ÓÐ18¸ö¾ßÓÐÏàͬÃû³Æ¡¢½á¹¹µÄϵͳ±í£¬Èç
±íSYSOBJECTSÓÃÓÚÃèÊöÊý¾Ý¿âÖеĶÔÏóÔæ±í¡¢ÊÓͼ¡¢´æ´¢¹ý³ÌµÈ£¬±íSYSUSERÓÃÓÚÃèÊöÊý¾Ý¿â
µÄÓû§£¬¶øMASTERÊý¾Ý¿âÁíÍ⻹ÓÐ13¸öµ¥¶ÀµÄÈ«¾Öϵͳ±í£¬Èç±íSYSLOGINSÓÃÓÚ±£´æÿ¸ö·þÎñ
Æ÷µÄµÇ¼Ãû¡¢¿ÚÁîºÍÅäÖÃÐÅÏ¢¡¢±íSYSDATABASE±£´æ·þÎñÆ÷ÉÏËùÓÐÊý¾Ý¿âÃû¡¢ËùÓÐÕß¡¢×´Ì¬¼°
ÆäËûÐÅÏ¢¡£ 
´æ´¢¹ý³ÌÊÇÄÚǶÓÚÊý¾Ý¿âÖеijÌÐò´úÂ룬ËüÓë±í¡¢ÊÓͼµÈÒ»ÑùÊÇÊý¾Ý¿âµÄÒ»¸ö×é³É²¿·Ö£¬²»
ͬÓÚÒ»°ãµÄÍⲿ³ÌÐò´úÂ룬ËüÊǾ­¹ýÔ¤±àÒë´¦ÀíµÄ´úÂ룬Òò´Ë¾ßÓÐÔËÐÐËٶȿ졢ЧÂʸߵÄÌصã
£¬´æ´¢¹ý³ÌÒ²ÊÇSQL ServerµÄÒ»¸öÖØÒª¹¦ÄÜ£¬Ðí¶àµ¥´¿Õë¶Ôºǫ́Êý¾Ý¿âµÄ²Ù×÷Ò»°ã¶¼½»ÓÉ´æ´¢
¹ý³ÌÀ´Íê³ÉÒÔÌá¸ßϵͳЧÂÊ¡£±¾ÎĽ«¸ø³öÒ»¸ö´æ´¢¹ý³ÌÀ´ËµÃ÷SQL Serverϵͳ±íµÄÓ¦Óᣠ
2. SQL Serverϵͳ±íµÄÓ¦Óà
ÔÚÓ¦ÓÃSQL ServerµÄ»ùÓÚ¿Í»§»ú/·þÎñÆ÷Ìåϵ½á¹¹µÄÐÅϢϵͳ¿ª·¢ÖУ¬ÓÐʱÐèÒª½«ºǫ́SQL S
erverÉϵÄijһÊý¾Ý¿âµÄ±í½á¹¹¶¼´òÓ¡³öÀ´£¬ÒÔ±ãÓÚ¿ª·¢ÈËÔ±²éÔļ°×îÖÕÎĵµµÄÐγɡ£SQL Se
rver±¾ÉíÌṩÁËÒ»¸öϵͳ´æ´¢¹ý³Ì(SP_COLUMNS)£¬¿ÉÒÔÍê³É¶Ôµ¥¸ö±í½á¹¹µÄ²éѯ£¬Ö»ÒªÔÚSLQ
ServerµÄISQL-W¹¤¾ßÖмüÈëSP_COLUMNS“±íÃû”£¬²¢Ö´Ðм´¿ÉµÃµ½½á¹û¼¯¡£µ«¸Ã·½·¨ÓÐÐí¶à
²»×ãÖ®´¦£¬ÆäÖ÷ҪȱµãÊÇ£º 
1)Ö»ÄܶÔÊý¾Ý¿âÖе¥¸öÊý¾Ý±í½øÐвÙ×÷£¬µ±ÐèÒª²éѯһ¸öÊý¾Ý¿âÖÐËùÓеıíʱ£¬ÐèÒª¶à´ÎÖ´
ÐÐϵͳ´æ´¢¹ý³ÌSP_COLUMNS£¬Òò´ËÏԵ÷dz£·±Ëö¡£ 
2)²éѯ½á¹û¼¯Öаüº¬ÁËÐí¶à²»±ØÒªµÄÐÅÏ¢£¬È±·¦Ê¹ÓõÄÁé»îÐÔ¡£ 
ÏÂÃæÎÒÃÇ´´½¨Ò»¸ö´æ´¢¹ý³ÌÀ´Íê³É¶Ôijһ¸öÊý¾Ý¿âÖÐËùÓбí½á¹¹µÄ²éѯ¡£ 
ÔÚ´´½¨Ò»¸öÊý¾Ý¿âµÄͬʱ£¬ÏµÍ³»á×Ô¶¯½¨Á¢Ò»Ð©ÏµÍ³±í£¬ÏÞÓÚƪ·ùµÄÔµ¹ÊÎÒÃÇÔÚÕâÀïÖ»½éÉÜ
ÓëÓ¦ÓÃʵÀýÓйصÄÈý¸öϵͳ±í(SYSOBJECTS£¬SYSCOLUMNS£¬SYSTYPES)¼°ÆäÏà¹ØµÄ×ֶΡ£ ±í
SYSOBJECTSΪÊý¾Ý¿âÄÚ´´½¨µÄÿ¸ö¶ÔÏó(Ô¼Êø£¬¹æÔò£¬±í£¬ÊÓͼ£¬´¥·¢Æ÷µÈ)´´½¨Ò»Ì


Ïà¹ØÎĵµ£º

ms sql Ò»´Î²åÈë¶àÌõ¼Ç¼µÄÓï¾ä

ÓеÄʱºòÎÒÃÇÐèÒªÒ»´ÎÏñÊý¾Ý¿âÖÐÌí¼Ó¶àÌõ¼Ç¼£¬ÎÒÃÇ¿ÉÒÔʹÓÃÏÂÃæµÄÓï¾äÀ´ÊµÏÖ£º
--Ìí¼ÓÒ»Ìõ¼Ç¼
INSERT INTO tableName(col1,col2,col3) VALUES (1,2,3)
--Ìí¼Ó¶àÌõ¼Ç¼
INSERT INTO tableName(col1,col2,col3)
SELECT 3,4,5
UNION ALL
SELECT 6,7,8
--´ÓÁíÍâµÄÒ»ÕűíÖжÁÈ¡¶àÌõÊý¾ÝÌí¼Óµ½Ð±íÖÐ
INSERT INTO tabl ......

VS2005×Ô´øSQL ExpressÅäÖÃ

ÏÂÃæÊDzÙ×÷²½Ö裺
1. “·þÎñºÍÁ¬½ÓµÄÍâΧӦÓÃÅäÖÓ -¡·“±¾µØÁ¬½ÓºÍÔ¶³ÌÁ¬½Ó”-¡·“ͬʱʹÓÃTCP/IPºÍNamed Pipes“£»
2. “·þÎñÅäÖùÜÀíÆ÷”-¡·“ÍøÂçÅäÖÔ-¡·“SQL ExpressµÄЭÒé“-¡·“IPµØÖ·”£¬½«IpAll Tcp¶Ë¿Ú¸ÄΪ1433£»
3.  ÖØÆô·þ ......

·À·¶sql×¢Èë¹¥»÷£¨ÉÏ£©

ͬ²½Ò»ÏÂÎÒbaiduµÄblog£ºhttp://hi.baidu.com/ncheng/blog/item/bc65f82a1a6a7c335343c11c.html
Sql×¢ÈëÊÇÒ»ÖÖÈëÃż«µÍÆÆ»µ¼«´óµÄ¹¥»÷·½Ê½¡£Èç¹ûsqlÊÇÓÃ×Ö·û´®Æ´½Ó³öÀ´µÄ»°£¬ÄÇô¿Ï¶¨»á±»×¢Èë¹¥»÷£¬Ç°¶Îʱ¼ä»¹´«³öÁËij¹úÍâ´óÐÍÉç½»ÍøÕ¾±»SQL×¢Èë¹¥»÷¡£
Sql×¢Èë¹¥»÷µÄ·½Ê½£¬À´ÕâÀï¿´µÄͬ־ÃÇÓ¦¸ÃºÜÇå³þÁË£¬¾ÍÊÇÔÚÆ´½Ó×Ö·û´ ......

SQL SERVER ÊÓͼ Garin Zhang

ÊÓͼ
SET¡¡NOCOUNT ON;
SET Northwind;
GO
IF OBJECT_ID('dbo.ViewName') IS NOT NULL
    DROP VIEW dbo.ViewName;
GO
CREATE VIEW dbo.Viewname
AS
SELECT * from customer AS C
WHERE EXISTS
    (SELECT * from dbo.Orders AS O
     WHERE O.CustomerI ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ