SQLÌæ»»Ö¸¶¨ÁÐ×Ö·û´®
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE replaceStr
-- Add the parameters for the stored procedure here
@keywords varchar(max),@afterwords varchar(max)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @word varchar(max);
declare @rowcount int;
declare @count int;
set @count = 1;
-- Insert statements for procedure here
begin try
begin tran replaceStr
select @rowcount = count(*) from Logfile;
while @count <= @rowcount
begin
select @word = lcontent from Logfile where lid = @count; --lcontentÁÐÃû£¬Logfile±íÃû£¬lid×ÔÔö³¤Ö÷¼ü
update Logfile set lcontent = replace(@word,@keywords,@afterwords) where lid = @count;
set @count = @count + 1;
end
commit tran
end try
begin catch
rollback tran
end catch
END
GO
Ïà¹ØÎĵµ£º
º¯Êý£º
XMLPARSE£º½âÎö×Ö·û»òÕß´ó¶ÔÏó¶þ½øÖÆÊý¾Ý£¬²úÉúXML
XMLSERIALIZE£º½«XMLֵת»»Îª×Ö·û»òÕß´ó¶ÔÏó¶þ½øÖÆÊý¾Ý
XMLVALIDATE£º¸ù¾ÝXML schemaУÑéXMLÖµµÄÓÐЧÐÔ
XMLEXISTS£º¼ì²âXQueryÊÇ·ñ·µ»Ø½á¹û£¨ÈçÓÉÒ»¸ö»ò¶à¸öÏîËù×é³ÉµÄÐòÁУ©
XMLQUERY£ºÖ´ÐÐÒ»¸öXQuery²¢ÒÔÒ»¸öÐòÁзµ»Ø½á¹û
XMLTABLE£ºÖ´ÐÐÒ»¸öXQuery£¬ÒÔ¹ØÏ ......
---//´´½¨·ÖÇø
CREATE PARTITION FUNCTION MarketInfo_Bak_partfunc(int)
AS RANGE RIGHT
FOR VALUES (10000,25000,40000)
--//´´½¨·ÖÇø¼Ü¹¹
CREATE PARTITION SCHEME MarketInfo_Bak_partscheme
¡¡¡¡AS PARTITION MarketInfo_Bak_partfunc
¡¡¡¡TO (fg1, fg2, fg3, fg4) --//fg1...fg4Îļþ×éÃû
--//¶Ô±í½ø ......
¡¡¡¡ÎÒ¾³£Åöµ½ÓÐÈË»áÎÊһЩÊý¾Ý¿âÓÅ»¯·½ÃæµÄÎÊÌ⣬ÎÒ¾õµÃÕâÊÇÒ»×î»ù±¾¼¼ÄÜÒªÇó£¬ÌرðÊÇʹÓÃsql server 2005£¬¶ÔÓÚsql serverµÄÓÅ»¯£¬Ê¹ÓõÄרְdba»ò¼æÖ°dbaÃǹ¤×÷¸üÇáËÉ£¬Ð§Âʸü¸ßÁË£¬µ«ÊÇ»¹ÊÇÓкܶàÐÂÈË¿ÉÄܲ»´óÁ˽⣬ÎÒÔÚÕâ¶ùдһÏÂ×î»ù±¾µÄһЩ½éÉÜ¡£
¡¡¡¡Ò»¡¢Ê×ÏȽéÉÜÒ»ÏÂsql server 2005ÖÐÓÅ»¯Êý¾ÝʱʹÓõ½µÄÁ½¸ö¹¤ ......
--´´½¨Óαê
DECLARE Cursor1 CURSOR FOR
SELECT NODE_NO,NODE_VALUE,SUM(RESALE_SUM-RESALERETU_SUM+SALE_SUM-SALERETU_SUM) sale_sum,
SUM(STORE_SUM) sum_store,SUM(STORE_SUM) store_sum,
sum(RESALE_PROFIT-RESALERETU_PROFIT+SALE_PROFIT-SALERETU_PROFIT-ADJUST_PROFIT) sale_profit
from ......