SQL SERVERÔÚ´æ´¢¹ý³ÌÖÐÁ¬½ÓÆäËûÊý¾Ý¿â
--·ÃÎʲ»Í¬µçÄÔÉϵÄÊý¾Ý¿â
--Èç¹û¾³£·ÃÎÊ»òÊý¾ÝÁ¿´ó,½¨ÒéÓÃÁ´½Ó·þÎñÆ÷
--´´½¨Á´½Ó·þÎñÆ÷
exec sp_addlinkedserver 'srv_lnk','','SQLOLEDB','Ô¶³Ì·þÎñÆ÷Ãû»òipµØÖ·'
exec sp_addlinkedsrvlogin 'srv_lnk','false',null,'Óû§Ãû','ÃÜÂë'
go
--²éѯʾÀý
select * from srv_lnk.Êý¾Ý¿âÃû.dbo.±íÃû
--µ¼ÈëʾÀý
select * into ±í from srv_lnk.Êý¾Ý¿âÃû.dbo.±íÃû
go
--´¦ÀíÍê³Éºóɾ³ýÁ´½Ó·þÎñÆ÷
exec sp_dropserver 'srv_lnk','droplogins'
Ïà¹ØÎĵµ£º
ÔÚPL/SQLÖÐÒýÈëÁË¿ØÖƽṹ£¬°üÀ¨Ñ¡Ôñ½á¹¹£¬Ñ»·½á¹¹ºÍÌøת½á¹¹
Ò» Ñ¡Ôñ½á¹¹
1,IF Óï¾ä
ÔÚPL/SQLÖУ¬Ñ¡Ôñ½á¹¹¿ÉÒÔͨ¹ýifÓï¾äÀ´ÊµÏÖ£¬Ò²¿ÉÒÔͨ¹ýCaseÓï¾ä£¨oracle9iÖУ©
ÀûÓÃifÓï¾äʵÏÖÑ¡Ôñ¿ØÖƵÄÓ﷨Ϊ£º
if condition1 then statements1 ......
ÕâЩº¯ÊýÔÚϵͳº¯Êý¿ÉÒÔÕÒµ½¡£ÏÂÃæÊÇÎÒÁ·Ï°Ê±Ð´µÄ´úÂ룬°üº¬Á˳£ÓõÄ×Ö·û´®²Ù×÷º¯Êý
/*********************************
³£ÓÃ×Ö·û´®º¯Êý:sqlÖÐûÓÐÊý×éÕâһ˵
*********************************/
--int charindex('ÒªÕÒµÄ×Ö·û´®','Ô´×Ö·û´®',¿ªÊ¼Î»ÖÃ)£¬»ñÈ¡×Ö·û´®ÖÐÖ¸¶¨×Ö·û´®µÄλÖÃ
declare @str varchar(50)
set ......
´æ´¢¹ý³Ì
ÔÚ´óÐÍÊý¾Ý¿âϵͳÖУ¬Ëæ׏¦ÄܵIJ»¶ÏÍêÉÆ£¬ÏµÍ³Ò²±äµÃÔ½À´Ô½¸´ÔÓ£¬´óÁ¿µÄʱ¼ä½«»áºÄ·ÑÔÚSQL´úÂëºÍÓ¦ÓóÌÐò´úÂëÉÏ£¬¿öÇÒÔںܶàÇé¿öÏ£¬Ðí¶à´úÂë±»Öظ´Ê¹Óöà´Î£¬Ã¿´Î¶¼ÊäÈëÏàͬµÄ´úÂë¼È·±ËöÓֻήµÍϵͳÔËÐÐЧÂÊ¡£Òò´Ë£¬SQL ServerÌṩÁËÒ»ÖÖ·½·¨£¬Ëü¿ÉÒÔ½«Ò»Ð©¹Ì¶¨µÄ²Ù×÷¼¯ÖÐÆðÀ´ÓÉSQL ServerÊý¾Ý¿â·þÎñÆ÷À´Íê³É£ ......
Ë÷Òý²Ù×÷
Êý¾Ý¿âÖеÄË÷ÒýÓëÊé¼®ÖеÄË÷ÒýÀàËÆ£¬ÔÚÒ»±¾ÊéÖУ¬ÀûÓÃË÷Òý¿ÉÒÔ¿ìËÙ²éÕÒËùÐèÐÅÏ¢£¬ÎÞÐëÔĶÁÕû±¾Êé¡£ÔÚÊý¾Ý¿âÖУ¬Ë÷ÒýʹÊý¾Ý¿â³ÌÐòÎÞÐë¶ÔÕû¸ö±í½øÐÐɨÃ裬¾Í¿ÉÒÔÔÚÆäÖÐÕÒµ½ËùÐèÊý¾Ý¡£ÊéÖеÄË÷ÒýÊÇÒ»¸ö´ÊÓïÁÐ±í£¬ÆäÖÐ×¢Ã÷Á˸÷¸ö´ÊµÄÒ³Âë¡£¶øÊý¾Ý¿âÖеÄË÷ÒýÊÇij¸ö±íÖÐÒ»ÁлòÕßÈô¸ÉÁÐÖµµÄ¼¯ºÏ£¬ºÍÏàÓ¦µÄÖ¸Ïò±íÖÐÎïÀí±ê ......
ͼ±í
ͼ±í(ÓֳƹØϵͼ)ÊÇSQL ServerÖÐÒ»ÀàÌØÊâµÄÊý¾Ý¿â¶ÔÏó£¬ËüÌṩ¸øÓû§Ö±¹ÛµØ¹ÜÀíÊý¾Ý¿â±íµÄ·½·¨¡£Í¨¹ýͼ±í£¬Óû§¿ÉÒÔÖ±¹ÛµØ´´½¨¡¢±à¼Êý¾Ý¿â±íÖ®¼äµÄ¹Øϵ£¬Ò²¿ÉÒÔ±à¼±í¼°ÆäÁеÄÊôÐÔ¡£ÀûÓÃÆóÒµ¹ÜÀíÆ÷´´½¨Í¼±íµÄ¾ßÌå²½ÖèÈçÏ£º
(1)ÔÚÆóÒµ¹ÜÀíÆ÷ÖУ¬Õ¹¿ªÖ¸¶¨µÄ·þÎñÆ÷ºÍÊý¾Ý¿â£¬´ò¿ªÒª½¨Á¢µÄͼ±íËùÔÚµÄÊý¾Ý¿â£¬ÓÒ»÷ͼ±íÍ ......