Sql Êý¾Ý¿â±¸·Ý
Êý¾Ý¿â±¸·Ý ×÷ÒµÖеÄSqlÓï¾ä£º
DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '_')
set @strPath = REPLACE(@strPath, '-' , '_')
set @strPath = REPLACE(@strPath, ' ' , '_')
set @strPath = 'F:\Êý¾Ý¿â±¸·Ý\' + myData_'+@strPath + '.bak'
BACKUP DATABASE [myData] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
×÷ҵɾ³ý
select * from msdb.dbo.sysmaintplan_subplans
select * from msdb.dbo.sysmaintplan_log
delete from msdb.dbo.sysmaintplan_subplans
delete from msdb.dbo.sysmaintplan_log
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
Ò»¡¢PL/SQL±à³Ì¹æ·¶Ö®´óСд
¾ÍÏñÔÚSQLÖÐÒ»Ñù£¬PL / SQLÖÐÊDz»Çø·Ö´óСдµÄ¡£ÆäÒ»°ã×¼ÔòÈçÏ£º
¹Ø¼ü×Ö(BEGIN, EXCEPTION, END, IF THEN ELSE,LOOP, END LOOP)¡¢Êý¾ÝÀàÐÍ(VARCHAR2, NUMBER)¡¢ÄÚ²¿º¯Êý(LEAST, SUBSTR)ºÍÓû§¶¨ÒåµÄ×Ó³ÌÐò(procedures, functions,packages)£¬Ê¹Óôóд¡£
±äÁ¿ÃûÒÔ¼°SQLÖеÄÁÐÃûºÍ±íÃû£¬Ê¹ÓÃÐ ......
SQLÓï¾äʵÏÖ£¬SQL Server 2000 ¼°ACCESS¸´ÖƾɱíOldTableµÄ½á¹¹£¬»ò½á¹¹¼°ÄÚÈݵ½ÐµıíNewTable
Á½¸ö¶¼ÊÔ¹ýÁË£¬ÏÂÃæµÄ´úÂëÔÚÕâÁ½¸öÊý¾Ý¿âÖУ¨SQL Server 2000 ¼°ACCESS£©¶¼ÊÇ¿ÉÒÔͨ¹ýµÄ¡£
--¸´ÖƱí½á¹¹ÎªÐµıí
select * into NewTable
from OldTable where 1=2
--¸´ÖƱí½á¹¹¼°ÄÚÈݵ½Ðµıí
select * into newtable
......
exists £¨sql ·µ»Ø½á¹û¼¯ÎªÕ棩
not exists (sql ²»·µ»Ø½á¹û¼¯ÎªÕ棩
ÈçÏ£º
±íA
ID NAME
1 A1
2 A2
3 A3
±íB
ID AID NAME
1 1 B1
2 2 B2
3 2 B3
±íAºÍ±íBÊÇ£±¶Ô¶àµÄ¹Øϵ A.ID => B.AID
......
ÏÖÔÚÓÃMSSQLµÄµØ·½Ì«¶àÁË£¬Óкܶà×ö¼¼ÊõµÄ¸öÈ˵çÄÔÉÏÒ²°²×°SQLרҵ°æ£¬ÒòΪËüÓõĶ࣬µ«ÓõÄÈ˶¼ÖªµÀ£¬SQLÓиö³¬¼¶Óû§sa£¬´ËÓû§Ä¬ÈÏÇé¿öÏ£¬ËüÖ¸Åɸø¹Ì¶¨·þÎñÆ÷½ÇÉ« sysadmin£¬²¢²»ÄܽøÐиü¸Ä¡£Ò»°ã¶®µã°²È«ÎÊÌâµÄ¼¼ÊõÈËÔ±¶¼»á°ÑÕâ¸öÃÜÂëÐ޸ĵô£¬µ«ÐÞ¸ÄÔÙ¸´ÔÓµÄÃÜÂ붼²»ÊǾø¶Ô°²È«µÄ£¬Ò»Ð©±©Á¦ÆƽâÈí¼þ£¬²ËÄñ¶¼»áÓá£
ÄÇ ......