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

SQLÍâ¼ü

´´½¨Íâ¼üÔ¼Êø
CREATE TABLE order_sample
(
orderid int PRIMARY KEY,
cust_id int FOREIGN KEY REFERENCES cuts_sample(cust_id) ON DELETE NO CASCADE
)
ON DELETE--ÓÃÓÚ¿ØÖƳ¢ÊÔɾ³ýÍâ¼üÏà¹ØÁªµÄÖ÷±íÖ¸ÏòÐÐʱ²ÉÈ¡µÄ²Ù×÷
-NO ACTION
ɾ³ýÍâ¼üÏà¹ØÁªµÄÖ÷±íÖ¸ÏòÐÐʱ£¬±¨´í
-CASCADE
ɾ³ýÍâ¼üÏà¹ØÁªµÄÖ÷±íÖ¸ÏòÐÐʱ£¬Á¬´øɾ³ýÍâ¼üµÄËùÓÐÐÐ
-SET NULL
ɾ³ýÍâ¼üÏà¹ØÁªµÄÖ÷±íÖ¸ÏòÐÐʱ£¬°ÑÍâ¼üÁÐÉèΪ¿Õ
-SET DEFAULT
ɾ³ýÍâ¼üÏà¹ØÁªµÄÖ÷±íÖ¸ÏòÐÐʱ£¬°ÑÍâ¼üÁÐÉèΪĬÈÏÖµ
ɾ³ýÍâ¼üÔ¼Êø
ALTER TABLE order_sample
DROP CONSTRAINT [FK__order_sam__cust___0425A276]
Ìí¼ÓÍâ¼ü
ALTER TABLE order_sample
ADD CONSTRAINT [FK__order_sam__cust___0425A276] FOREIGN KEY(cust_id) REFERENCES cuts_sample(cust_id) ON DELETE  SET NULL 
ON UPADTE ÓÚON DELETE·½·¨Ò»Ñù


Ïà¹ØÎĵµ£º

Oracle PL/SQLÓïÑÔÈëÃÅ

Ò»¡¢±³¾°½éÉÜ
¡¡¡¡
¡¡¡¡½á¹¹»¯²éѯÓïÑÔ(Structured Query Language£¬¼ò³ÆSQL)ÊÇÓÃÀ´·ÃÎʹØϵÐÍÊý¾Ý¿âÒ»ÖÖͨÓÃÓïÑÔ£¬ÊôÓÚµÚËÄ´úÓïÑÔ£¨4GL£©£¬ÆäÖ´ÐÐÌصãÊǷǹý³Ì»¯£¬¼´²»ÓÃÖ¸Ã÷Ö´ÐеľßÌå·½·¨ºÍ;¾¶£¬¶øÊǼòµ¥µØµ÷ÓÃÏàÓ¦Óï¾äÀ´Ö±½ÓÈ¡µÃ½á¹û¼´¿É¡£ÏÔÈ»£¬ÕâÖÖ²»¹Ø×¢ÈκÎʵÏÖϸ½ÚµÄÓïÑÔ¶ÔÓÚ¿ª·¢ÕßÀ´ËµÓÐ׿«´óµÄ±ãÀû¡£È»¶ø£¬Ó ......

oracle sqlÓïÑÔÄ£ºý²éѯ ͨÅä·ûlikeµÄʹÓý̳Ì

ÔÚWhere×Ó¾äÖУ¬¿ÉÒÔ¶Ôdatetime¡¢char¡¢varchar×Ö¶ÎÀàÐ͵ÄÁÐÓÃLike×Ó¾äÅäºÏͨÅä·ûÑ¡È¡ÄÇЩ“ºÜÏñ...”µÄÊý¾Ý¼Ç¼£¬ÒÔÏÂÊÇ¿ÉʹÓõÄͨÅä·û£º
%   Áã»òÕ߶à¸ö×Ö·û
_    µ¥Ò»ÈκÎ×Ö·û£¨Ï»®Ïߣ©
\     ÌØÊâ×Ö·û
[]     ÔÚijһ·¶Î§ÄÚµÄ×Ö·û£¬Èç ......

Linq to sqlϵÁÐÎÄÕÂ


Ò»²½Ò»²½Ñ§Linq to sql£¨Ò»£©£ºÔ¤±¸ÖªÊ¶
Ò»²½Ò»²½Ñ§Linq to sql£¨¶þ£©£ºDataContextÓëʵÌå 
Ò»²½Ò»²½Ñ§Linq to sql£¨Èý£©£ºÔöɾ¸Ä
Ò»²½Ò»²½Ñ§Linq to sql£¨ËÄ£©£º²éѯ¾ä·¨
Ò»²½Ò»²½Ñ§Linq to sql£¨Î壩£º´æ´¢¹ý³Ì
Ò»²½Ò»²½Ñ§Linq to sql£¨Áù£©£ºÌ½¾¿ÌØÐÔ 
Ò»²½Ò»²½Ñ§Linq to sql£¨Æߣ©£º²¢·¢ÓëÊÂÎñ ......

SQL ServerÈçºÎ¿çʵÀý·ÃÎÊÊý¾Ý¿â

ÔÚÎÒÃÇÈÕ³£Ê¹ÓÃSQL ServerÊý¾Ý¿âʱ£¬¾­³£Óöµ½ÐèÒªÔÚʵÀýInstance01ÖпçʵÀý·ÃÎÊInstance02ÖеÄÊý¾Ý¡£ÀýÈçÔÚ×öÊý¾ÝǨÒÆʱ£¬ÈçÏÂÓï¾ä:
insert into Instance01.DB01.dbo.Table01
          select * from Instance02.DB01.dbo.Table01
ÆÕͨÇé¿öÏ£¬ÕâÑù×öÊDz»ÔÊÐíµÄ£¬ÒòΪSQ ......

ÔÚSQLÖÐÏò¶à¸öÊý¾Ý¿âÖвåÈëÏàͬµÄ¼Ç¼

½ñÌìÒ»¸öÅóÓÑÎʵ½Õâ¸öÎÊÌ⣬ÆäʵºÜºÃ½â¾ö£º
declare   @dbname   varchar(50)  
  declare   c_database   cursor   for  
      select   name   from   master.dbo.sysdatabas ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ