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
Ïà¹ØÎĵµ£º
¾µäSQLÓï¾ä´óÈ«
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
¡¡¡¡SQL·ÖÀࣺ
¡¡¡¡DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢Ë ......
×î½ü×öÏîÄ¿µÄʱºò£¬Óöµ½ÁËÒ»¸öÎÊÌâ¡£ÎÒÖ÷ÒªÊÇ×öÒ»¸öWeb Services¸ø±ðÈËÓõġ£±ðÈË´«Ò»¸öÓû§IDºÅ¹ýÀ´£¬È»ºóÎÒ½«Õâ¸öÓû§µÄËùÓкÃÓѵÄÏÂÔؼǼ°ü×°³ÉÒ»¸öDataSet·µ»ØÈ¥¡£ ¶ø¸ù¾ÝÓû§IDºÅ»ñÈ¡¸ÃÓû§µÄËùÓкÃÓÑÐÅÏ¢£¬ÔòÊÇͨ¹ýÁíÒ»¸öWeb ServicesµÃµ½µÄ£¬ÕâÀïΪFriendDS¡£
......
.PivotµÄÓ÷¨Ìå»á:
Óï¾ä·¶Àý:
select PN,[2006/5/30] as [20060530],[2006/6/2] as [20060602]
from consumptiondata a
Pivot (sum(a.M_qty) FOR a.M_date in ([2006/5/30],[2006/6/2])) as PVT
order by PN
Table½á¹¹ Consumptiondata (PN,M_Date,M_qty)
order by PN¿ÉÒª¿É²»Òª,²¢²»ÖØ ......
ת×Ô http://database.ctocio.com.cn/222/9068222.shtml
1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
¡¡¡¡2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
¡¡¡¡3¡¢Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
¡¡¡¡4¡¢ÄÚ´æ²»×ã
¡¡¡¡5¡¢ÍøÂçËÙ¶ÈÂý
¡¡¡¡6¡¢²éѯ³öµÄÊý¾ÝÁ¿¹ý´ó(¿ÉÒÔ²É ......
Èí¼þÊÇÃâ·ÑʹÓõģ¬×Ô¼º¹¤×÷ÖÐÒ²Ò»Ö±Óã¬Óкܶ๦ÄÜÏëÔö¼Ó£¬ÓÉÓÚʱ¼äÔÒòûȥÕûÀíÐèÇó¡£×Ô´ÓÈ¥Äê·¢²¼V1.0.0°æºóûÓÐÔÚ·¢²¼ÁË£¬±¾´ÎÖ÷ÒªÊÇÔö¼ÓÁ˽âÃÜOracle10g¼ÓÃܶÔÏñµÄ¹¦ÄÜ£¬ÁíÍâ×öÁËһЩСµÄÓÅ»¯£¬·¢ÉÏÀ´Óë´ó¼Ò·ÖÏíһϣ¬ÒòΪÊÇBeta°æ£¬ËùÒÔÒ²Çë´ó¼ÒÁ½⣬Èç¹ûÔÚʹÓýâÃܹ¦ÄÜʱÓöµ½ÎÊÌâ¿ÉÒÔ·¢E ......