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

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


Ïà¹ØÎĵµ£º

ÔÚ×öSQL¹ÊÕÏתÒÆȺ¼¯µÄʱºòÓ¦¸ÃÑ¡ÔñÄÄÖÖģʽ£¿

Èç¹ûÎÒÃǵÄSQL ServerÒª±£Ö¤¸ß¿ÉÓÃÐÔ£¬ÄÇô¿ÉÒÔ²ÉÓùÊÕÏתÒÆȺ¼¯¡£×î¼òµ¥µÄ¹ÊÕÏתÒÆȺ¼¯ÊÇÁ½Ì¨·þÎñÆ÷£¬Ò»Ì¨×ö»î¶¯µÄ·þÎñÆ÷£¬Áíһ̨×ö±¸Ó÷þÎñÆ÷£¬Õâ¾ÍÊÇAPģʽµÄCluster¡£ÁíÍâÒ»¸öģʽ¾ÍÊÇAAģʽ£¬Ò²¾ÍÊÇÁ½Ì¨·þÎñÆ÷¶¼ÊÇÔËÐÐSQL ServerʵÀý¡£
SQL Server²»ÏñOracleÒ»ÑùÓÐRAC£¬ËùÒÔ²»¿ÉÄÜ˵Á½Ì¨·þÎñÆ÷ͬʱÔËÐÐͬһ¸öʵÀý£¬Ïë ......

PL/SQL developerÔ¶³Ì·ÃÎÊÊý¾Ý¿âÅäÖ÷½·¨

ʹÓÃPL/SQL developerÔ¶³Ì·ÃÎÊoracleÊý¾Ý¿âʱ£¬Ê×ÏÈҪȷ¶¨±¾»úÖÐ×°ÓÐoracle¿Í»§¶Ë¡£Ä¿Ç°»¹²»ÖªµÀÄÄÀïµ¥¶ÀµÄoracle¿Í»§¶Ë°²×°°ü¡££¨ÒòΪÎÒÓõÄÊÇoracle10g£¬oracle10g°²×°µÄ¹ý³ÌÖÐûÓÐÌض¨µÄ¿Í»§¶ËÑ¡ÏËùÒÔÎÒÒ»°ã¶¼ÊÇÔÚ±¾»úÓð²×°oracleËùÓй¦ÄÜ£©
ÔÚ±¾»ú°²×°ºÃoracle¿Í»§¶Ëºó£¬ÎÒÃÇÔÚ±¾»ú(¼´¿Í»§¶Ë)µÄoracleµÄ°²×°Ä¿Â¼Ï ......

hibernateɾ³ý²Ù×÷µÄsqlÓï¾äд·¨

 
µÚÒ»ÖÖ£º
public void deleteUser(String byemail) {
  Session session = getSession();
  Transaction transaction = null;
  String hql = "delete from Register where email=?
";
  try {
   transaction = session.beginTransactio ......

·ÀÖ¹SQL×¢Èë

Ò»¡¢Ê¹ÓòÎÊý»¯ÊäÈë¡£´æ´¢¹ý³ÌÀᄀÁ¿±ÜÃâÓï¾äÆ´½Ó¡£
¶þ¡¢¶ÔÓÚһЩÊý¾Ý¿â£¬±ØÐëÉèÖÃȨÏÞ£¬ÉõÖÁÉèÖõ½×ֶΡ£
Èý¡¢Ê¼ÖÕͨ¹ý²âÊÔÀàÐÍ¡¢³¤¶È¡¢¸ñʽºÍ·¶Î§À´ÑéÖ¤Óû§ÊäÈë¡£
ËÄ¡¢¹ýÂËÃô¸Ð×Ö·û¡£
Function ReplaceStr(Str)
Str=Trim(Str)
Str=Replace(Str,"'","'")
Str=Replace(Str,";",";")
Str=Rep ......

SQL ServerÖлã×ܹ¦ÄܵÄʹÓÃGROUPING,ROLLUPºÍCUBE

1.Óà CUBE »ã×ÜÊý¾Ý
 CUBE ÔËËã·ûÉú³ÉµÄ½á¹û¼¯ÊǶàάÊý¾Ý¼¯¡£¶àάÊý¾Ý¼¯ÊÇÊÂʵÊý¾ÝµÄÀ©Õ¹£¬ÊÂʵÊý¾Ý¼´¼Ç¼¸ö±ðʼþµÄÊý¾Ý¡£À©Õ¹½¨Á¢ÔÚÓû§´òËã·ÖÎöµÄÁÐÉÏ¡£ÕâЩÁб»³ÆΪά¡£¶àάÊý¾Ý¼¯ÊÇÒ»¸ö½á¹û¼¯£¬ÆäÖаüº¬Á˸÷ά¶ÈµÄËùÓпÉÄÜ×éºÏµÄ½»²æ±í¸ñ¡£ CUBE ÔËËã·ûÔÚ SELECT Óï¾äµÄ GROUP BY ×Ó¾äÖÐÖ¸¶¨¡£¸ÃÓï¾äµÄÑ¡ÔñÁбíÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ