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

¶¯Ì¬´´½¨Sql ServerÊý¾Ý¿âÏà¹Ø£¨È«£©

 
CREATE DATABASE
´´½¨Ò»¸öÐÂÊý¾Ý¿â¼°´æ´¢¸ÃÊý¾Ý¿âµÄÎļþ£¬»ò´ÓÏÈÇ°´´½¨µÄÊý¾Ý¿âµÄÎļþÖи½¼ÓÊý¾Ý¿â¡£
˵Ã÷ ÓйØÓë DISK INIT Ïòºó¼æÈÝÐԵĸü¶àÐÅÏ¢£¬Çë²Î¼û"Microsoft® SQL Server™ Ïòºó¼æÈÝÐÔÏêϸÐÅÏ¢"ÖеÄÉ豸£¨¼¶±ð 3£©¡£
Óï·¨
CREATE DATABASE database_name
[ ON
[ < filespec > [ ,...n ] ]
[ , < filegroup > [ ,...n ] ]
]
[ LOG ON { < filespec > [ ,...n ] } ]
[ COLLATE collation_name ]
[ FOR LOAD | FOR ATTACH ]
< filespec > ::=
[ PRIMARY ]
( [ NAME = logical_file_name , ]
FILENAME = 'os_file_name'
[ , SIZE = size ]
[ , MAXSIZE = { max_size | UNLIMITED } ]
[ , FILEGROWTH = growth_increment ] ) [ ,...n ]
< filegroup > ::=
FILEGROUP filegroup_name < filespec > [ ,...n ]
²ÎÊý
database_name
ÐÂÊý¾Ý¿âµÄÃû³Æ¡£Êý¾Ý¿âÃû³ÆÔÚ·þÎñÆ÷ÖбØÐëΨһ£¬²¢ÇÒ·ûºÏ±êʶ·ûµÄ¹æÔò¡£database_name ×î¶à¿ÉÒÔ°üº¬ 128 ¸ö×Ö·û£¬³ý·ÇûÓÐΪÈÕÖ¾Ö¸¶¨Âß¼­Ãû¡£Èç¹ûûÓÐÖ¸¶¨ÈÕÖ¾ÎļþµÄÂß¼­Ãû£¬Ôò Microsoft® SQL Server™ »áͨ¹ýÏò database_name ×·¼Óºó׺À´Éú³ÉÂß¼­Ãû¡£¸Ã²Ù×÷ÒªÇó database_name ÔÚ 123 ¸ö×Ö·ûÖ®ÄÚ£¬ÒÔ±ãÉú³ÉµÄÈÕÖ¾ÎļþÂß¼­ÃûÉÙÓÚ 128 ¸ö×Ö·û¡£
ON
Ö¸¶¨ÏÔʽ¶¨ÒåÓÃÀ´´æ´¢Êý¾Ý¿âÊý¾Ý²¿·ÖµÄ´ÅÅÌÎļþ£¨Êý¾ÝÎļþ£©¡£¸Ã¹Ø¼ü×Öºó¸úÒÔ¶ººÅ·Ö¸ôµÄ <filespec> ÏîÁÐ±í£¬<filespec> ÏîÓÃÒÔ¶¨ÒåÖ÷Îļþ×éµÄÊý¾ÝÎļþ¡£Ö÷Îļþ×éµÄÎļþÁбíºó¿É¸úÒÔ¶ººÅ·Ö¸ôµÄ <filegroup> ÏîÁÐ±í£¨¿ÉÑ¡£©£¬<filegroup> ÏîÓÃÒÔ¶¨ÒåÓû§Îļþ×é¼°ÆäÎļþ¡£
n
ռλ·û£¬±íʾ¿ÉÒÔΪÐÂÊý¾Ý¿âÖ¸¶¨¶à¸öÎļþ¡£
LOG ON
Ö¸¶¨ÏÔʽ¶¨ÒåÓÃÀ´´æ´¢Êý¾Ý¿âÈÕÖ¾µÄ´ÅÅÌÎļþ£¨ÈÕÖ¾Îļþ£©¡£¸Ã¹Ø¼ü×Öºó¸úÒÔ¶ººÅ·Ö¸ôµÄ <filespec> ÏîÁÐ±í£¬<filespec> ÏîÓÃÒÔ¶¨ÒåÈÕÖ¾Îļþ¡£Èç¹ûûÓÐÖ¸¶¨ LOG ON£¬½«×Ô¶¯´´½¨Ò»¸öÈÕÖ¾Îļþ£¬¸ÃÎļþʹÓÃϵͳÉú³ÉµÄÃû³Æ£¬´óСΪÊý¾Ý¿âÖÐËùÓÐÊý¾ÝÎļþ×Ü´óСµÄ 25%¡£
FOR LOAD
Ö§³Ö¸Ã×Ó¾äÊÇΪÁËÓëÔçÆÚ°æ±¾µÄ Microsoft SQL Server ¼æÈÝ¡£Êý¾Ý¿âÔÚ´ò¿ª dbo use only Êý¾Ý¿âÑ¡ÏîµÄÇé¿öÏ´´½¨£¬²¢ÇÒ½«Æä״̬ÉèÖÃΪÕýÔÚ×°ÔØ¡£SQL Server 7.0 °æÖв»ÐèÒª¸Ã×Ӿ䣬ÒòΪ RESTORE Óï¾ä¿ÉÒÔ×÷Ϊ»¹Ô­²Ù×÷µÄÒ»²¿·ÖÖØд´½¨Êý¾Ý¿â¡£
FOR ATTACH
Ö¸¶¨´ÓÏÖÓеÄÒ»×é²Ù×÷ϵͳÎļþÖи½¼ÓÊý¾Ý¿â¡£±ØÐ


Ïà¹ØÎĵµ£º

SQL²éѯÓï¾ä¾«»ª

 Ò»¡¢ ¼òµ¥²éѯ
¼òµ¥µÄTransact-SQL²éѯֻ°üÀ¨Ñ¡ÔñÁÐ±í¡¢from×Ó¾äºÍWHERE×Ӿ䡣ËüÃÇ·Ö±ð˵Ã÷Ëù²éѯÁС¢²éѯµÄ
±í»òÊÓͼ¡¢ÒÔ¼°ËÑË÷Ìõ¼þµÈ¡£
ÀýÈ磬ÏÂÃæµÄÓï¾ä²éѯtesttable±íÖÐÐÕÃûΪ“ÕÅÈý”µÄnickname×ֶκÍemail×ֶΡ£
SELECT nickname,email
from testtable
WHERE name='ÕÅÈý'
(Ò») Ñ¡ÔñÁÐ ......

ORACLE PL/SQL ¼¯ºÏѧϰ±Ê¼Ç(¶þ)

Èý¡¢Ç¶Ì×±íµÄʹÓ÷½·¨
 
1¡¢½«Ç¶Ì×±í¶¨ÒåΪPL/SQLµÄ³ÌÐò¹¹Ôì¿é
 
TYPE type_name IS TABLE OF element_type[NOT NULL];
 
ÈçÏÂÀýËùʾ£º
DECLARE

-- Define a nested table of variable length strings.
TYPE card_table IS TABLE OF VARCHAR2(5 CHAR);

-- Declare and initialize a n ......

¾«ÃîSQLÓï¾äÊÕ¼¯

SQLÓï¾äÏÈǰдµÄʱºò£¬ºÜÈÝÒ×°ÑһЩÌØÊâµÄÓ÷¨Íü¼Ç£¬ÎÒÌØ´ËÕûÀíÁËÒ»ÏÂSQLÓï¾ä²Ù×÷£¬·½±ã×Ô¼ºÐ´SQLʱ·½±ãÒ»µã£¬ÏëÌùÉÏÀ´£¬Ò»Æð¿´¿´£¬Í¬Ê±Ï£Íû´ó¼ÒÄܹ²Í¬¶à¶àÌáÒâ¼û£¬Ò²¸øÎÒÁôһЩ¸üºÃµÄ¼Ñ¾ä£¬ÕûÀíÒ»·Ý¡¶¾«ÃîSQLËÙ²éÊֲᡷ£¬²»Áߴͽ̣¡
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾ ......

ʹÓÃTRY/CATCHÓï¾ä½â¾öSQL Server 2005ËÀËø

      ÈÃÎÒÃÇ´ÓÕâÑùÒ»¸öʾÀý¿ªÊ¼ËµÆð£¬ËüÔÚ SQL Server 2000 ºÍ 2005 Öж¼ÄÜÒýÆðËÀËø¡£ÔÚ±¾ÎÄÖУ¬ÎÒʹÓà SQL Server 2005 µÄ×îРCTP£¨ÉçÇø¼¼ÊõÔ¤ÀÀ£¬Community Technology Preview£©°æ±¾£¬SQL Server 2005 Beta 2£¨7 Ô·¢²¼£©Ò²Í¬ÑùÊÊÓá£Èç¹ûÄúûÓÐ Beta 2 »ò×îÐ嵀 CTP °æ±¾£¬ÇëÏÂÔØ SQL Serve ......

ORACLE SQLÓï¾äÓÅ»¯×ܽá

ORACLE SQLÓï¾äÓÅ»¯×ܽá
 
1£© Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLEµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐ3¸öÒÔÉϵıíÁ¬½Ó²éѯ, Ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ