SQL Server 2005ÖÐдÎļþµÄ·½·¨
--´´½¨Ð´ÎļþµÄ´æ´¢¹ý³Ì
ALTER proc [dbo].[p_movefile]
@filename varchar(1000),--Òª²Ù×÷µÄÎı¾ÎļþÃû
@text varchar(8000), --ҪдÈëµÄÄÚÈÝ
@obj int
as
begin
declare @err int,
@src varchar(255),
@desc varchar(255)
exec @err=sp_oamethod @obj, 'OpenTextFile', @obj out, @filename,8,1
if @err<>0
goto lberr
exec @err=sp_oamethod @obj,'WriteLine',null,@text
if @err<>0
goto lberr
exec @err=sp_oadestroy @obj
return
lberr:
exec sp_oageterrorinfo 0, @src out,@desc out
select cast(@err as varbinary(4)) as ´íÎóºÅ,@src as ´íÎóÔ´,@desc as ´íÎóÃèÊö
end
--µ÷ÓÃÉÏÃæµÄp_movefileµÄ´æ´¢¹ý³Ì£¬½«Êý¾Ý¿â²éѯÄÚÈÝдÈëµ½ÎļþÖÐÈ¥ALTER proc [dbo].[abc]
as
declare @SummarizationState int, @LocalUpdateID int, @TargetID int
declare @obj int
declare @newline char(2)
declare @fulFileName nvarchar(256),
@content nvarchar(4000)
declare C Cursor for
select SummarizationState, LocalUpdateID, TargetID from tbUpdateStatusPerComputer
begin
--set nocount on
exec master..xp_cmdshell 'del C:\sql.txt';
--exec sp_oacreate 'Scripting.FileSystemObject',@obj out
--exec sp_OADestroy @obj;
exec sp_oacreate 'Scripting.FileSystemObject',@obj out
OPEN C
Fetch Next from C into @SummarizationState, @LocalUpdateID, @TargetID
set @content=N'';
set @newline='\n';
while @@Fetch_status=0
begin
set @content=N'TargetID:'+convert(nvarchar(15),@TargetID);
set @content=@content + N' LocalUpdateID:'+ conv
Ïà¹ØÎĵµ£º
Ò»¡¢PowerDesignerÉú³ÉsqlÎÊÌâ
Éú³ÉsqlµÄ·½·¨ÊÇ Database -->Generate Database (Ctrl + G ) µ«ÊÇÌáʾ
Generation aborted due to errors detected during the verification of the model.
½â¾ö·½·¨: ½«check model È¥µô¾Í¿ÉÒÔÁË.ÆäÖУ¬one file onÊÇ·ñÐèÒª°´ÕÕ±íÉú³ÉÐí¶à¸ösql£¨Ä¬ÈÏÑ¡ÉÏ£¬¼´²»ÐèÒª£©
& ......
ÒýÓÃ×Þ½¨µÄ£º
Cod
SELECT
±íÃû=case when a.colorder=1 then d.name else '' end,
×Ö¶ÎÐòºÅ=a.colorder,
......
¾µäSQLÓï¾ä´óÈ«
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
¡¡¡¡SQL·ÖÀࣺ
¡¡¡¡DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢Ë ......
1. SET DEADLOCK_PRIORITY
˵Ã÷£º¿ØÖÆÔÚ·¢ÉúËÀËøÇé¿öʱ»á»°µÄ·´Ó¦·½Ê½¡£Èç¹ûÁ½¸ö½ø³Ì¶¼Ëø¶¨Êý¾Ý£¬²¢ÇÒÖ±µ½ÆäËü½ø³ÌÊÍ·Å×Ô¼ºµÄËøʱ£¬Ã¿¸ö½ø³Ì²ÅÄÜÊÍ·Å×Ô¼ºµÄËø£¬¼´·¢ÉúËÀËøÇé¿ö¡£
Óï·¨£ºSET DEADLOCK_PRIORITY { LOW | NORMAL | @deadlock_var }
²ÎÊý£ºLOW Ö¸¶¨µ±Ç°»á»°ÎªÊ×Ñ¡ËÀËøÎþÉüÆ·¡£Microsoft® S ......
ÉêÃ÷¡£ÎÄÕ½ö´ú±í¸öÈ˹۵㣬ÓëËùÔÚ¹«Ë¾ÎÞÈκÎÁªÏµ¡£
1. ¸ÅÊö
ÍøÒ³¹ÒÂíÕâ¸ö»°ÌâÏëÀ´´ó¼Ò²¢²»Ä°Éú¡£ÎªÊ²Ã´ÓÐÕâô¶àµÄÍøÒ³ÉÏ´æÔÚ×ÅľÂíÈ¥¹¥»÷ÆÕͨÓû§£¿²»¿É·ñÈÏ£¬Ï൱һ²¿·ÖÍøÒ³Ô±¾¾ÍÊǶñÒâµÄ£ºÍøÒ³µÄ×÷Õß¹ÊÒâÔÚÉÏÃæ·ÅÉÏľÂí£¬È»ºóͨ¹ý¸÷ÖÖÊÖ¶ÎÒýÓÕÓû§È¥ä¯ÀÀ¡£µ«ÊǾø´ó¶àÊý±»¹ÒÂíµÄÍøÒ³Ô±¾ÊÇÕý³ ......