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

ÔÚSQL SERVERÖÐʵÏÖRSA¼ÓÃÜËã·¨(µÚ¶þ°æ)

/***************************************************  
        ×÷Õߣºherowang(ÈÃÄãÍû¼ûÓ°×ÓµÄǽ£©
    ÈÕÆÚ£º2010.1.5
          ×¢£º    ×ªÔØÇë±£Áô´ËÐÅÏ¢
    ¸ü¶àÄÚÈÝ£¬Çë·ÃÎÊÎҵIJ©¿Í£ºblog.csdn.net/herowang
****************************************************/
/*
   ±¾´ÎÐÞ¸ÄÔö¼ÓÁËunicodeµÄÖ§³Ö£¬µ«ÊǼÓÃܺóÒÀÈ»ÏÔʾΪ16½øÖÆÊý¾Ý£¬ÒòΪ½øÐÐRSA¼ÓÃܺóËùµÃµ½µÄunicode±àÂëÊÇÎÞ·¨ÏÔʾµÄ£¬ËùÒÔÃÜÎÄÒÀÈ»²ÉÓÃ16½øÖÆÊý¾ÝÏÔʾ¡£
    ÐèÒªÌØ±ð×¢Ò⣺Èç¹ûÒª¶ÔÖÐÎĽøÐмÓÃÜ£¬ÄÇôËùѡȡµÄÁ½¸öËØÊýÒª±È½Ï´ó£¬Á½¸öËØÊýµÄ³É¼¨×îºÃÒª´óÓÚ65536£¬¼´´óÓÚunicodeµÄ×î´ó±àÂëÖµ
    ÁíÍâÐÞ¸ÄÁ˵ÚÒ»¸ö°æ±¾µÄ²¿·Öº¯ÊýÃû³Æ
*/
 
ÔÚSQL SERVERÖÐʵÏÖRSA¼ÓÃÜËã·¨
--ÅжÏÊÇ·ñÎªËØÊý
if object_id('f_primeNumTest') is not null
  drop function f_primeNumTest
go
create function [dbo].[f_primeNumTest]
(@p int)
returns bit
begin
  declare @flg bit,@i int
  select @flg=1, @i=2
  while @i<sqrt(@p)
  begin
     if(@p%@i=0  )
     begin
        set @flg=0
       break
     end 
     set @i=@i+1
  end
  return @flg
end
go
--ÅжÏÁ½¸öÊýÊÇ·ñ»¥ËØ
 
if object_id('f_isNumsPrime') is not null
  drop function f_isNumsPrime
go
create function f_isNumsPrime
(@num1 int,@num2 int)
returns bit
begin
  declare @tmp int,@flg bit
  set @flg=1
  while (@num2%@num1<>0)
  begin
    select @tmp=@num1,@num1=@num2%@num1,@num2=@tmp
  end
  if @num1=1
     set @flg=0
  return @flg
end
go
--²úÉúÃÜÔ¿¶Ô
if object_id('p_createKey') is not null
  drop proc p_createKey
go
create proc p_createKey
@p int,@q int
as
begin
    decla


Ïà¹ØÎĵµ£º

SQL XML DELETE

--A. ´Ó´æ´¢ÔÚ·ÇÀàÐÍ»¯µÄ xml ±äÁ¿ÖеÄÎĵµÖÐɾ³ý½Úµã
DECLARE @myDoc xml
SET @myDoc = '<?Instructions for=TheWC.exe ?>
<Root>
 <!-- instructions for the 1st work center -->
<Location LocationID="10" LaborHours="1.1" MachineHours=".2" >
 Some text 1
 <st ......

SQL Server 2005 ²»ÔÊÐíÔ¶³ÌÁ¬½Ó½â¾ö·½·¨

SQL Server 2005 ²»ÔÊÐíÔ¶³ÌÁ¬½Ó½â¾ö·½·¨
 
¸Õ¸Õ°²×°µÄÊý¾Ý¿âϵͳ£¬°´ÕÕĬÈϰ²×°µÄ»°£¬ºÜ¿ÉÄÜÔÚ½øÐÐÔ¶³ÌÁ¬½Óʱ±¨´í£¬Í¨³£ÊÇ´íÎó:"ÔÚÁ¬½Óµ½ SQL Server 2005 ʱ£¬
ÔÚĬÈϵÄÉèÖÃÏ SQL Server ²»ÔÊÐí½øÐÐÔ¶³ÌÁ¬½Ó¿ÉÄܻᵼÖ´Ëʧ°Ü¡£
(provider: ÃüÃû¹ÜµÀÌṩ³ÌÐò, error: 40 - ÎÞ·¨´ò¿ªµ½ SQL Server µÄÁ¬½Ó) "ËÑM ......

sqlÖ®left join¡¢right join¡¢inner joinµÄÇø±ð

left join(×óÁª½Ó) ·µ»Ø°üÀ¨×ó±íÖеÄËùÓмǼºÍÓÒ±íÖÐÁª½á×Ö¶ÎÏàµÈµÄ¼Ç¼
right join(ÓÒÁª½Ó) ·µ»Ø°üÀ¨ÓÒ±íÖеÄËùÓмǼºÍ×ó±íÖÐÁª½á×Ö¶ÎÏàµÈµÄ¼Ç¼
inner join(µÈÖµÁ¬½Ó) Ö»·µ»ØÁ½¸ö±íÖÐÁª½á×Ö¶ÎÏàµÈµÄÐÐ
¾ÙÀýÈçÏ£º
--------------------------------------------
±íA¼Ç¼ÈçÏ£º
aID¡¡¡¡¡¡¡¡¡¡aNum
1¡¡¡¡¡¡¡¡¡¡a ......

SQL°´ÕÕÈÕ¡¢ÖÜ¡¢Ô¡¢Äêͳ¼ÆÊý¾Ý

SQL°´ÕÕÈÕ¡¢ÖÜ¡¢Ô¡¢Äêͳ¼ÆÊý¾Ý ÊÕ²Ø
ÎÄÕ²ο¼£ºhttp://www.cnblogs.com/wenbhappy/archive/2008/07/02/1233660.html
Èç: 
±í:consume_record 
×Ö¶Î:consume (moneyÀàÐÍ) 
date (datetimeÀàÐÍ) 
ÇëÎÊÔõôдËÄÌõsqlÓï¾ä·Ö±ð°´ÈÕ,°´ÖÜ,°´ÔÂ,°´¼¾Í³¼ÆÏû·Ñ×ÜÁ¿. 
Èç:1Ô 1200Ô ......

SQL ÿ¸ö·ÖÀà¸÷È¡2ÌõÊý¾Ý

create table tb (ptoid int,proclassid int,proname varchar(10))
insert tb
select 1,1,'Ò·þ1'
union all
select 2,2,'Ò·þ2'
union all
select 3,3,'Ò·þ3'
union all
select 4,3,'Ò·þ4'
union all
select 5,2,'Ò·þ5'
union all
select 6,2,'Ò·þ6'
union all
select 7,2,'Ò·þ7'
union all
select 8 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ