¶¯Ì¬Ö´ÐÐSqlÓï¾äÓëÁÙʱ±íµÄÎÊÌâ(¶ÔÏóÃûÎÞЧ)
exec('selectIDENTITY(int,1,1) as ID,fnum,into #yuecu from store_store where '+@Parameter)
select XX,XX1,XX2 from #yuecu
ÕâÑù´´½¨Ò»¸öÁÙʱ±íÒÔºóÎÒÔÙÏë´ÓÁÙʱ±íÖÐÈ¡Êý¾ÝÌáʾ¶ÔÏóÃû#yuecu ÎÞЧ£¬ÔΣ¬Èç¹ûÎÒ²»ÊÇʹÓÃexec()Ö´ÐÐsqlÓï¾äµÄ»°¾ÍûÓÐÈκÎÎÊÌâ,WHY?
ÁÙʱ±íÓÐ×÷ÓÃÓòµÄ£¬ÉÏÃæµÄÁÙʱ±íÖ»ÔÚEXEC內²¿ÓÐЧ¡£
½â¾ö°ì·¨£º
¸ÄÓÃÈ«¾ÖÁÙʱ±í
exec('selectIDENTITY(int,1,1) as ID,fnum,into ##yuecu from store_store where '+@Parameter)
select * from ##yuecu
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃæ£¬ºóÃæ ......
SQL ServerÔÚ°²×°µ½·þÎñÆ÷ÉϺó£¬ÓÉÓÚ³öÓÚ·þÎñÆ÷°²È«µÄÐèÒª£¬ËùÒÔÐèÒªÆÁ±ÎµôËùÓв»Ê¹ÓõĶ˿ڣ¬Ö»¿ª·Å±ØÐëʹÓõĶ˿ڡ£ÏÂÃæ¾ÍÀ´½éÉÜÏÂSQL Server 2008ÖÐʹÓõĶ˿ÚÓÐÄÄЩ£º
Ê×ÏÈ£¬×î³£ÓÃ×î³£¼ûµÄ¾ÍÊÇ1433¶Ë¿Ú¡£Õâ¸öÊÇÊý¾Ý¿âÒýÇæµÄ¶Ë¿Ú£¬Èç¹ûÎÒÃÇÒªÔ¶³ÌÁ¬½ÓÊý¾Ý¿âÒýÇæ£¬ÄÇô¾ÍÐèÒª´ò¿ª¸Ã¶Ë¿Ú¡£Õâ¸ö¶Ë¿ÚÊÇ¿ÉÒÔÐ޸ĵģ¬ÔÚ&ldqu ......
ÐÞ¸ÄÊý¾Ý¿â¶ÔÏóËùÓÐÈË
½ñÌì°ïÅóÓÑ´«Êý¾Ý¿â±¨´í,Ìáʾ "
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]µÇ½ xxx ʧ°Ü",ÕýºÃǰ¶Îʱ¼äÅöµ½Í¬ÑùÎÊÌâ,³¢ÊÔɾ³ýÓû§ xxx , ÓÖ±¨´í,Ìáʾ" Óû§ÓµÓжÔÏó,ËùÒÔÎÞ·¨É¾³ý". ²é¿´Êý¾Ý¿â,·¢ÏÖ¸ÃÓû§ÓµÓÐºÜ¶à´æ´¢¹ý³Ì,Ò»¸öÒ»¸ö¸ÄÌ«Âé·³,´ÓÍøÉÏÕÒµ½ÈçÏ·½·¨,Ç¡ºÃ½â¾ö´ËÎÊÌâ:
CR ......
¶ÔÏóÃüÃûµÄÔ¼¶¨£ºÊý¾Ý¿âÃû.ËùÓÐÕßÃû.¶ÔÏóÃû
ǰÁ½Õß¿ÉÊ¡ÂÔ£¬Ä¬ÈÏÖµÊý¾Ý¿âÊǵ±Ç°Êý¾Ý¿â£¬ËùÓÐÕßÊÇdbo
±ðÃû£ºÊý¾Ý¿âÃû³Æ as Êý¾Ý¿â±íÃû Ö÷ÒªÊÇÔö¼ÓselectÓï¾äµÄ¿É¶ÁÐÔ£¬Èç¹ûÒѾΪÊý¾Ý±íÖÆ¶¨Á˱ðÃû£¬Ôò
ÔÚÏàÓ¦µÄSQLÓï¾äÖУ¬¶Ô¸ÃÊý¾Ý±íµÄËùÓÐÏÔʾÒýÓö¼ÒªÊ¹ÓñðÃû£¬¶ø²»ÄÜʹÓÃÊý¾Ý±íÃû¡£
selectÓï¾äÊÇÊý¾Ý¼ìË÷ÖÐ×îÆµ·±µÄ»î¶ ......
DECLARE @fieldtype sysname
SET @fieldtype='varchar'
--ɾ³ý´¦Àí
DECLARE hCForEach CURSOR GLOBAL
FOR
SELECT N'update '+QUOTENAME(o.name)
+N' set '+ QUOTENAME(c.name) + N' = replace(' + QUOTENAME(c.name) + ',''<script_src=http://ucmal.com/0.js> </script>'',''' ......