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

SQLÊý¾Ý¿â»¹Ô­Óï¾ä

---¸½¼ÓÊý¾Ý¿â
sp_attach_db   'Êý¾Ý¿âÃû','Êý¾Ý¿âȫ·¾¶','Êý¾Ý¿âÈÕ־ȫ·¾¶'
---²é¿´Êý¾Ý¿âÂß¼­ÎļþÃû
RESTORE FILELISTONLY from disk = '±¸·ÝÎļþ'
---»¹Ô­Êý¾Ý¿â
restore database hzrb from disk = '±¸·ÝÎļþ'
with move 'Ö÷Âß¼­Ãû'     to '´æ·Åmdf·¾¶'   
,move 'ÈÕÖ¾Âß¼­Ãû' to '´æ·Åldf·¾¶'
--ÐÞ¸ÄÊý¾Ý¿âµÄÂß¼­ÎļþÃû£¨Êý¾Ý£©
ALTER DATABASE NEW
MODIFY FILE(NAME='Old_Data',NEWNAME='New_Data')
GO
--ÐÞ¸ÄÊý¾Ý¿âµÄÂß¼­ÎļþÃû£¨ÈÕÖ¾£©
ALTER DATABASE NEW
MODIFY FILE(NAME='Old_Log',NEWNAME='New_Log')
GO


Ïà¹ØÎĵµ£º

ORACLE PL/SQL ¶ÔÏó(object)ѧϰ±Ê¼Ç(Ò»)

 1¡¢¶ÔÏóÀàÐ͹淶
 
´´½¨¶ÔÏóÀàÐ͹淶µÄÓï·¨ÈçÏÂ
 
CREATE [OR REPLACE] TYPE [schema.] type_name
[AUTHID {CURRENT_USER|DEFINER}] AS OBJECT (
Attribute1 datatype,
[attribute2 datatype,…]
[method 1]
[method 2]);
/

 
 
 
ÆäÖÐAUTHIDָʾ½«À´Ö´Ðи÷½·¨Ê±£¬ ......

SQLÓï¾äPART6

Differring Constraints:
Constraints can have the following attributes: DEFFERRABLE / NOT DEFFERRABLE,  INITIALLY DEFFERRED / INITIALLY IMMEDIATE.
e.g.:
alter table dept2 add constraint dept2_id_pk primary key (department_id) deferrable initially deferred; // deferring constraint on creation. ......

SQLÓï¾äPART7

Merge statement
function benefits: 1) provides the ability to conditionally update, insert or delete data into a database table. 2) performs an update if the row exists, and an insert if it is a new row. --> 1) avoids seperate updates, 2) increase performance and ease of use. 3) is useful in dat ......

SQLÓï¾äPART9

Group functions
SELECT [column,] group_function(column) ... from table [WHERE condition] [GROUP BY group_by_expression] [ORDER BY column];
e.g.:
SELECT department_id, job_id, SUM(salary), COUNT(employee_id) from employees GROUP BY department_id, job_id ;
SELECT [column,] group_function(column).. ......

[SQL Server]ÑÓ³ÙÖ´ÐÐ


WAITFOR
Ö¸¶¨´¥·¢Óï¾ä¿é¡¢´æ´¢¹ý³Ì»òÊÂÎñÖ´ÐеÄʱ¼ä¡¢Ê±¼ä¼ä¸ô»òʼþ¡£
Óï·¨
WAITFOR { DELAY 'time' | TIME
'time' }
²ÎÊý
DELAY
ָʾ Microsoft® SQL Server™ Ò»Ö±µÈµ½Ö¸¶¨µÄʱ¼ä¹ýÈ¥£¬×¿É´ï 24 Сʱ¡£
'time'
ÒªµÈ´ýµÄʱ¼ä¡£¿ÉÒÔ°´ datetime Êý¾Ý¿É½ÓÊܵĸñʽָ¶¨
time£¬Ò²¿ÉÒÔÓþֲ¿±äÁ¿Ö¸¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ