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

SQL SERVERʹÓÃÊÂÎñÈÕÖ¾»Ö¸´Êý¾ÝµÄʵÑé

/*
ʹÓÃÊÂÎñÈÕÖ¾»Ö¸´Êý¾ÝµÄʵÑé
*/
--1.´´½¨²âÊÔÊý¾Ý¿â
CREATE DATABASE Db_test
ON
( NAME = Db_test_DATA,
      FILENAME = 'c:\Db_test.mdf' )
LOG ON
( NAME = Db_test_LOG,
   FILENAME = 'c:\Db_test.ldf')
GO
--2.¹ÊÕÏ»¹Ô­Ä£ÐÍÉèÖÃΪfullÄ£ÐÍ,ĬÈϵļòµ¥Ä£Ðͱ¸·ÝÊÂÎñÈÕÖ¾ÊÇûÓõÄ
ALTER   DATABASE   Db_test   SET   RECOVERY   FULL   |   BULK_LOGGED
--3.´´½¨²âÊÔ±í
CREATE TABLE [dbo].[BackupTabToTxt] (
 [TabName] [varchar] (200)  ,
)
--4.²åÈë²âÊÔÊý¾Ý
insert into BackupTabToTxt(TabName) values('test1')
insert into BackupTabToTxt(TabName) values('test2')
insert into BackupTabToTxt(TabName) values('test3')
select * from BackupTabToTxt
--5.±¸·ÝÊý¾Ý¿â
BACKUP DATABASE Db_test TO DISK='c:\test_data.bak'
--6.ɾ³ýÊý¾Ý,±¸·ÝÈÕÖ¾
delete from BackupTabToTxt where TabName='test3'  --17:06
BACKUP LOG Db_test TO DISK='c:\test_log_1706.bak' --±¸·ÝÈÕÖ¾
delete from BackupTabToTxt where TabName='test2'  --17:07
BACKUP LOG Db_test TO DISK='c:\test_log_1707.bak' --±¸·ÝÈÕÖ¾
select * from BackupTabToTxt
--7.ʹÓÃÊÂÎñÈÕÖ¾»Ö¸´Êý¾Ý
RESTORE database Db_test from DISK='c:\test_data.bak'  WITH NORECOVERY
RESTORE LOG Db_test from DISK='c:\test_log_1706.bak' with stopat='2009-09-24 17:06' ,NORECOVERY
RESTORE LOG Db_test from DISK='c:\test_log_1707.bak' with stopat='2009-09-24 17:07'
select * from BackupTabToTxt
--8.ɾ³ý²âÊÔ¿â
drop database Db_test


Ïà¹ØÎĵµ£º

¾¡Á¿±ÜÃâÔÚSQLÓï¾äÖÐʹÓÃOR

----start
    ÔÚSQLÓï¾äÖÐÓ¦¸Ã¾¡Á¿±ÜÃâʹÓÃOR£¬ÒòΪÕâÑù×ö»áÓ°ÏìSQLÓï¾äµÄÐÔÄÜ¡£¿¼ÂÇÏÂÃæµÄÇé¿ö£º
CREATE TABLE USER
(
NAME VARCHAR(20) NOT NULL,---ÐÕÃû
BIRTHDAY DATE---ÉúÈÕ
); 
ÏÖÔÚÓÐÕâÑùÒ»¸öÎÊÌ⣺ÈÃÄã²éÕÒÒ»ÏÂÉúÈÕÊÇ1949-10-1£¨¹²ºÍ¹úͬÁäÈË£©»ò1978-12-18£¨Ê®Ò»½ìÈýÖÐÈ«»áÕÙ¿ªÊ±¼ä£© ......

¾¡Á¿±ÜÃâÔÚSQLÓï¾äµÄWHERE×Ó¾äÖÐʹÓú¯Êý

----start
    ÔÚSQLÓï¾äµÄ WHERE ×Ó¾äÖÐÓ¦¸Ã¾¡Á¿±ÜÃâÔÚ×Ö¶ÎÉÏʹÓú¯Êý£¬ÒòΪÕâÑù×ö»áʹ¸Ã×Ö¶ÎÉϵÄË÷ÒýʧЧ£¬Ó°ÏìSQLÓï¾äµÄÐÔÄÜ¡£¼´Ê¹¸Ã×Ö¶ÎÉÏûÓÐË÷Òý£¬Ò²Ó¦¸Ã±ÜÃâÔÚ×Ö¶ÎÉÏʹÓú¯Êý¡£¿¼ÂÇÏÂÃæµÄÇé¿ö£º
CREATE TABLE USER
(
NAME VARCHAR(20) NOT NULL,---ÐÕÃû
REGISTERDATE TIMESTAMP---×¢² ......

£¨×îгɹ¦£©Ãâ°²×°OracleÔËÐÐpl/sql developer

1.µ½http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/htdocs/winsoft.htmlÏÂÔØ
11.1.0.7.0 °æµÄ¼´Ê±¿Í»§¶Ë³ÌÐò°ü — Basic£¨²»ÊÇBasic Lite£©
2.½«ÏÂÔص½µÄÎļþ½âѹ£¬½âѹºóÎÒ½«Ä¿Â¼instantclient_11_1ÀïµÄÈ«²¿Îļþ¿½±´µ½ÁËÒ»¸öеÄĿ¼£ºE:\programs\OracleClient¡£ÄãÒ²¿ÉÒÔ²»¿½±´£¬Ö ......

תÔØ Sqlµ¼Èëµ½´¦Excel

/*=================== µ¼Èë/µ¼³ö Excel µÄ»ù±¾·½·¨ ===================*/
¡¡¡¡
¡¡¡¡´ÓExcelÎļþÖÐ,µ¼ÈëÊý¾Ýµ½SQLÊý¾Ý¿âÖÐ,ºÜ¼òµ¥,Ö±½ÓÓÃÏÂÃæµÄÓï¾ä:
¡¡¡¡
¡¡¡¡/*===================================================================*/
¡¡¡¡--Èç¹û½ÓÊÜÊý¾Ýµ¼ÈëµÄ±íÒѾ­´æÔÚ
¡¡¡¡insert into ±í select * from
¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ