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

´æ´¢¹ý³ÌµÄ´´½¨¼°Ê¹ÓÃ(sqlserver 2005)

´æ´¢¹ý³ÌµÄ´´½¨¼°Ê¹ÓÃ(sqlserver 2005)
´´½¨´æ´¢¹ý³Ì¡£´æ´¢¹ý³ÌÊÇÒѱ£´æµÄ Transact-SQL Óï¾ä¼¯ºÏ£¬»ò¶Ô Microsoft .NET Framework ¹«¹²ÓïÑÔÔËÐÐʱ (CLR) ·½·¨µÄÒýÓ㬿ɽÓÊÕ²¢·µ»ØÓû§ÌṩµÄ²ÎÊý¡£¿ÉÒÔ´´½¨¹ý³Ì¹©ÓÀ¾ÃʹÓ㬻òÔÚÒ»¸ö»á»°£¨¾Ö²¿ÁÙʱ¹ý³Ì£©ÖÐÁÙʱʹÓ㬻òÔÚËùÓлỰ£¨È«¾ÖÁÙʱ¹ý³Ì£©ÖÐÁÙʱʹÓá£
Æô¶¯ SQL Server µÄÒ»¸öʵÀýʱ£¬Ò²¿ÉÒÔ´´½¨²¢×Ô¶¯ÔËÐд洢¹ý³Ì¡£
 Transact-SQL Óï·¨Ô¼¶¨
Óï·¨
 
CREATE { PROC | PROCEDURE } [schema_name.] procedure_name [ ; number ]
    [ { @parameter [ type_schema_name. ] data_type }
        [ VARYING ] [ = default ] [ [ OUT [ PUT ]
    ] [ ,...n ]
[ WITH <procedure_option> [ ,...n ]
[ FOR REPLICATION ]
AS { <sql_statement> [;][ ...n ] | <method_specifier> }
[;]
<procedure_option> ::=
    [ ENCRYPTION ]
    [ RECOMPILE ]
    [ EXECUTE_AS_Clause ]
<sql_statement> ::=
{ [ BEGIN ] statements [ END ] }
<method_specifier> ::=
EXTERNAL NAME assembly_name.class_name.method_name
 
±¸×¢
Transact-SQL ´æ´¢¹ý³ÌµÄ×î´ó´óСΪ 128 MB¡£
Ö»ÄÜÔÚµ±Ç°Êý¾Ý¿âÖд´½¨Óû§¶¨Òå´æ´¢¹ý³Ì¡£ÁÙʱ¹ý³Ì¶Ô´ËÊǸöÀýÍ⣬ÒòΪËüÃÇ×ÜÊÇÔÚ tempdb Öд´½¨¡£Èç¹ûδָ¶¨¼Ü¹¹Ãû³Æ£¬ÔòʹÓô´½¨¹ý³ÌµÄÓû§µÄĬÈϼܹ¹¡£Óйؼܹ¹µÄÏêϸÐÅÏ¢£¬Çë²ÎÔÄÓû§¼Ü¹¹·ÖÀë¡£
ÔÚµ¥¸öÅú´¦ÀíÖУ¬CREATE PROCEDURE Óï¾ä²»ÄÜÓëÆäËû Transact-SQL Óï¾ä×éºÏʹÓá£
ĬÈÏÇé¿öÏ£¬²ÎÊý¿ÉΪ¿ÕÖµ¡£Èç¹û´«µÝ NULL ²ÎÊýÖµ²¢ÇÒÔÚ CREATE »ò ALTER TABLE Óï¾äÖÐʹÓøòÎÊý£¬¶ø¸ÃÓï¾äÖб»ÒýÓÃÁÐÓÖ²»ÔÊÐíʹÓÿÕÖµ£¬ÔòÊý¾Ý¿âÒýÇæ »á²úÉúÒ»¸ö´íÎó¡£ÈôÒª×èÖ¹Ïò²»ÔÊÐíʹÓÿÕÖµµÄÁд«µÝ NULL£¬ÇëΪ¹ý³ÌÌí¼Ó±à³ÌÂß¼­£¬»òʹÓà CREATE TABLE »ò ALTER TABLE µÄ DEFAULT ¹Ø¼ü×Ö£¬ÒÔ±ã¶Ô¸ÃÁÐʹÓÃĬÈÏÖµ¡£
´æ´¢¹ý³ÌÖеÄÈκΠCREATE TABLE »ò ALTER TABLE Óï¾ä¶¼½«×Ô¶¯´´½¨ÁÙʱ±í¡£½¨Òé¶ÔÓÚÁÙʱ±íÖеÄÿÁУ¬ÏÔʽָ¶¨ NULL »ò NOT NULL¡£Èç¹ûÔÚ CREATE TABLE »ò ALTER TABLE Óï¾äÖÐδ½øÐÐÖ¸¶¨£¬Ôò ANSI_DFLT_ON ºÍ ANSI_DFLT_OFF Ñ¡Ï¿ØÖÆÊý¾Ý¿âÒýÇæ ΪÁÐÖ¸ÅÉ NULL »ò NOT NULL ÊôÐԵķ½Ê½¡£Èç¹ûij¸öÁ¬½ÓÖ´ÐеĴ洢¹ý³Ì¶ÔÕâЩ


Ïà¹ØÎĵµ£º

SQLServerËø»úÖÆÑо¿

 
Ïà¹ØÎÄÕÂ:  
mysqlÊý¾Ý¿âËø
ORACLEÀXÖÖËøģʽ
ÍƼöȦ×Ó: Pipboy
¸ü¶àÏà¹ØÍƼö
new Draggable("related_topics");

¶ÔËø»úÖƵÄÑо¿Òª¾ß±¸Á½¸öÌõ¼þ£º
1£®Êý¾ÝÁ¿´ó
2£®¶à¸öÓû§Í¬Ê±²¢·¢
Èç¹ûȱÉÙÕâÁ½¸öÌõ¼þ£¬Êý¾Ý¿â²»ÈÝÒײúÉúËÀËøÎÊÌâ¡£Ñо¿ÆðÀ´¿ÉÄÜ»áʱ¶¹ ......

SQLServer ÅúÁ¿²åÈëÊý¾ÝµÄÁ½ÖÖ·½·¨

SQLServer ÅúÁ¿²åÈëÊý¾ÝµÄÁ½ÖÖ·½·¨
2009-07-27 19:31
ÔÚSQL Server ÖвåÈëÒ»ÌõÊý¾ÝʹÓÃInsertÓï¾ä£¬µ«ÊÇÈç¹ûÏëÒªÅúÁ¿²åÈëÒ»¶ÑÊý¾ÝµÄ»°£¬Ñ­»·Ê¹ÓÃInsert²»½öЧÂʵͣ¬¶øÇһᵼÖÂSQLһϵͳÐÔÄÜÎÊÌâ¡£ÏÂÃæ½éÉÜSQL ServerÖ§³ÖµÄÁ½ÖÖÅúÁ¿Êý¾Ý²åÈë·½·¨£ºBulkºÍ±íÖµ²ÎÊý(Table-Valued Parameters)¡£
    &nb ......

´«ÖDz¥¿ÍÎÒµÄSqlServer½Å±¾

 
======================SqlServer´ó²¿·Ö֪ʶ¶¼ÔÚÎÒÕâ½Å±¾Àï===============
Èç¹ûÄãÄÜ°ÑÊý¾Ý½á¹¹»­³öÀ´µÄ»°£¬ÄÇôÄã¾ÍÈëÃÅÁË£¡£¡ºÇºÇ£¡£¡
--²é¿´konwyoumore¿âÊÇ·ñ´æÔÚ
USE master
IF exists(SELECT * from sysdatabases WHERE name='KnowYouMore')
BEGIN
DROP DATABASE knowyoumore;
END
GO
--´´½¨konwyo ......

OracleÖÐÓëSQLSERVER ISNULLº¯ÊýÏàͬ×÷Óõĺ¯Êý

NVL(Expr1,Expr2)Èç¹ûExpr1ΪNULL£¬·µ»ØExpr2µÄÖµ£¬·ñÔò·µ»ØExpr1µÄÖµ
NVL2(Expr1,Expr2,Expr3)Èç¹ûExpr1ΪNULL£¬·µ»ØExpr2µÄÖµ£¬·ñÔò·µ»ØExpr3µÄÖµ
NULLIF(Expr1,Expr2)Èç¹ûExpr1ºÍExpr2µÄÖµÏàµÈ£¬·µ»ØNULL£¬·ñÔò·µ»ØExpr1µÄÖµ ......

´¥·¢Æ÷µÄ´´½¨¼°Ê¹ÓÃ(sqlserver 2005)

´¥·¢Æ÷µÄ´´½¨¼°Ê¹ÓÃ(sqlserver 2005)
´´½¨ DML »ò DDL ´¥·¢Æ÷¡£´¥·¢Æ÷ÊÇÊý¾Ý¿â·þÎñÆ÷Öз¢Éúʼþʱ×Ô¶¯Ö´ÐеÄÌØÖÖ´æ´¢¹ý³Ì¡£Èç¹ûÓû§ÒªÍ¨¹ýÊý¾Ý²Ù×÷ÓïÑÔ (DML) ʼþ±à¼­Êý¾Ý£¬ÔòÖ´ÐÐ DML ´¥·¢Æ÷¡£DML ʼþÊÇÕë¶Ô±í»òÊÓͼµÄ INSERT¡¢UPDATE »ò DELETE Óï¾ä¡£DDL ´¥·¢Æ÷ÓÃÓÚÏìÓ¦¸÷ÖÖÊý¾Ý¶¨ÒåÓïÑÔ (DDL) ʼþ¡£ÕâЩÖ÷ÒªÊÇ CRE ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ