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

´¥·¢Æ÷»ñÈ¡Ð޸ıíµÄSQLÓï¾ä


/*
´¥·¢Æ÷»ñÈ¡SQLÓï¾äÔöÁ¿´«Êä
¹¦ÄÜ£º²¶×½Ð޸ıíµÄSQLÓï¾ä
ʹÓÃ˵Ã÷£º 1¡¢ÏÈн¨Ò»±íÊÖ¶¯Ð´ÈëÖ÷¼üÐÅÏ¢»òÕßΨһË÷Òý
   Create table prmary_key
   (tab_name varchar(255),
    key_name varchar(255))
   --´Ë±í½öÔÚ½¨Á¢´¥·¢Æ÷ʱʹÓ㬽¨ÍêËùÓд¥·¢Æ÷ºó ¼ÇµÃɾ³ý
   2¡¢½¨´¥·¢Æ÷½öÐèÒªÐÞ¸Ä@tab_name±äÁ¿£¬¼´¿É
Create By Yujiang
*/
Declare @cursql  varchar(8000),
 @cursqltmp varchar(8000),
 @curkey  Varchar(500),  --Ö÷¼ü»òΨһË÷Òý
 @curkeytmp Varchar(2000),  --Ö÷¼üÑ­»·ÓÃ
 @curkeywhere Varchar(1000),  --Ö÷¼üÌõ¼þ
 @curkeyjoin Varchar(1000),  --¹ØÁªÌõ¼þ
 @curexecsql varchar(5000),  --Ö´ÐÐSQL
 @curcols varchar(2000),  --ËùÓеÄÁÐÃû
 @curcolstmp varchar(2000),  --Ñ­»·ÓÃ
 @tab_name varchar(255),
 @curtmp  varchar(255),  --Ñ­»·ÓÃ
 @curcoltype varchar(255)  --×Ö¶ÎÊý¾ÝÀàÐÍ
Set @tab_name = 'tj_suggestion'  --¡ïÐèÒªÊÖ¶¯ÐÞ¸Ä
Select @cursql = ' if exists(select * from sysobjects where name = '+ char(39) + 'tr_' + @tab_name +'_ZLYJ' + char(39) + ' and type = ''TR'')'
               + char(13) + char(10)
        + ' drop trigger  tr_'+ @tab_name + '_ZLYJ'
Exec(@cursql)
--»ñÈ¡Ö÷¼ü
Select @curkey = key_name from prmary_key where tab_name =  @tab_name
if (@curkey is Null or @curkey = '')
Begin
 Print @tab_name + 'ûÓÐÖ÷¼ü»òΨһË÷ÒýÎÞ·¨²¶×½SQLÓï¾ä'
 Return
End
Set @curcols = ''
Set @cursqltmp = ''
if right(@curkey,1) <> ','
 Set @curkey = @curkey + ','
 declare @col_name varchar(50)
 Declare #tmp_cur cursor
 for select name from syscolumns where id = object_id(@tab_name)
 open #tmp_cur
 fetch next from #tmp_cur into @col_name
 while @@fetch_status = 0
 &nbs


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

Sql Server ×Ö·û´®¾ÛºÏº¯Êý

 Sql Server ÓÐÈçϼ¸Ö־ۺϺ¯ÊýSUM¡¢AVG¡¢COUNT¡¢COUNT(*)¡¢MAX ºÍ MIN£¬µ«ÊÇÕâЩº¯Êý¶¼Ö»ÄܾۺÏÊýÖµÀàÐÍ£¬ÎÞ·¨¾ÛºÏ×Ö·û´®¡£Èçϱí:AggregationTable
Id Name
1 ÕÔ
2 Ç®
1 Ëï
1 Àî
2 ÖÜ
Èç¹ûÏëµÃµ½ÏÂͼµÄ¾ÛºÏ½á¹û
Id Name
1 ÕÔËïÀî
2 Ç®ÖÜ
ÀûÓÃSUM¡¢AVG¡¢COUNT¡¢COUNT(*)¡¢MAX ºÍ MINÊÇÎÞ·¨×öµ½µ ......

ÇÚÕÜEXCEL·þÎñÆ÷×óÓÒÄÚÁ¬½Ó¼°ÔÚSQLÓï¾äµÄʵ¼Ê×÷ÓÃ

   ÔÚÇÚÕÜEXCEL·þÎñÆ÷ÖÐÓÐ×óÓÒÄÚÁ¬½ÓµÄ²Ù×÷£¬ÎÒÃÇÔÚÕâÀïÓÃSQLÓï¾äÀ´Êµ¼Ê˵Ã÷Ò»ÏÂÖ®¼äµÄÇø±ðÓë×÷Óá£
    =     ÄÚÁ¬½Ó  SQLÖÐΪinner join
   *=    ×óÁ¬½Ó °üº¬ËùÓеÄ×ó±ß±íÖеļǼÉõÖÁÊÇÓұ߱íÖÐûÓкÍËüÆ¥ÅäµÄ¼Ç¼¡£ SQLÖÐΪleft j ......

SQL Server Á¬½Ó×Ö·û´®ºÍÉí·ÝÑéÖ¤

SQL Server .NET Data Provider Á¬½Ó×Ö·û´®°üº¬Ò»¸öÓÉһЩÊôÐÔÃû/Öµ¶Ô×é³ÉµÄ¼¯ºÏ¡£Ã¿Ò»¸öÊôÐÔ/Öµ¶Ô¶¼ÓɷֺŸô¿ª¡£
         PropertyName1=Value1;PropertyName2=Value2;PropertyName3=Value3;.....
ͬÑù£¬Á¬½Ó×Ö·û´®±ØÐë°üº¬SQL ServerʵÀýÃû³Æ:
     ......

64λwin7°²×°Ê¹ÓÃPL/SQL developerÁ¬½ÓOracle 10g±¸Íü

ÔÚÍøÉÏËÑË÷ÁË°ëÌ죬Ö÷ÒªÔ­ÒòÊÇoci.dllÊÇ64λµÄ,¶øPL/SQL developerÖ»ÓÐ32λµÄ,ÔÚʹÓÃ64λoci.dllÎļþʱ³ö´í.
ÔÚÍøÉÏÕÒÁ˺ܶà×ÊÁÏ,×î·½±ãµÄ½â¾ö·½°¸ÈçÏÂ:
1.µ½oracle¹ÙÍøÏÂÔØOracle InstantClient,ÎÒϵÄÊÇinstantclient-basiclite-win32-10.2.0.4.zip,°ÑËü½âѹËõµ½
oracle°²×°Ä¿Â¼productÏÂ,ÆäÖл¹ÓÐÒ»¸öĿ¼Ϊ10.2.0. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ