mssql´æ´¢¹ý³ÌÖÐÈÝ´í´¦Àí - MS-SQL Server / »ù´¡Àà
exec YYys 'aa' aaÊÇmssql·ÇÕýÈ·µÄÓï¾ä, ÀïÃæÊÇͨ¹ý exec (@sql)--ÉÏÃæaaËù´«µÝµÄ²ÎÊý¾ÍÊÇ@sqlµ÷Óõģ¬Èç¹ûÈçºÎÈÃexec @sql³ö´íºó´æ´¢¹ý³ÌÄÜÊä³ö´íÎó¡£
Õâ¸ö? Ã²ËÆºÜÄÑ,ÀàËÆÈËΪ´íÎóÖ»ÄÜ´ÓÐÐÕþ·½ÃæÈëÊÖ. ûÀí½âlzµÄÄ¿µÄ SQL code: declare @msg nvarchar(4000) declare @severity int IF @@ERROR <> 0 BEGIN select @msg=description,@severity=severity from sysmessages where msglangid = 2052 and error=@@ERROR --print @msg RAISERROR (@msg, @severity, 1) END SQL code: declare @msg nvarchar(4000) declare @severity int exec('aa') IF @@ERROR <> 0 BEGIN select @msg=description,@severity=severity from sysmessages where msglangid = 2052 and error=@@ERROR --print @msg RAISERROR (@msg, @severity, 1) END /* ·þÎñÆ÷: ÏûÏ¢ 2812£¬¼¶±ð 16£¬×´Ì¬ 62£¬ÐÐ 1 ÕÒ²»µ½´æ´¢¹ý³Ì 'aa'¡£ */ÒýÓà SQL code declare @msg nvarchar(4000) declare @severity int exec('aa') IF @@ERROR <> 0 BEGIN select @msg=description,@severity=severity from sysmessages where msglangid = 2052 and error=@@¡¡ /* ·þÎñÆ÷: ÏûÏ¢ 2812£¬¼¶±ð 16£¬×´Ì¬ 62£¬ÐÐ 1 ÕÒ²»µ½´æ´¢¹ý³Ì 'aa'¡£ */
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£ ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î date(Ö÷) outid(Ö÷) inid(Ö÷) num amt 2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
sqlµÄÈí¼þÔÚÄÄÀï¿ÉÒÔϰ¡£¡ÔÚÍøÉÏÕÒÁËÂù¶à¶¼Óò»Á˰¡ Ëæ±ã¸ãÒ»D°æ°É£¬ ѸÀ×µÚÒ»¸ö¾Í¿ÉÒÔÓà 2000,2005¶¼ÕâÑù http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......
tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£© tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname ½á¹û£º µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......
ÇëÎÊ Ìí¼ÓÐÂÊý¾ÝÔ´->Êý¾Ý¿â->Ìí¼ÓÁ¬½Ó Õâ¸ö½çÃæÏ£¬Êý¾ÝÔ´Ñ¡Ôñ£ºMicrosoft SQL Server (SqlClient)£» ·þÎñÆ÷Ãû£º Ó¦¸ÃÐ´Ê²Ã´ÄØ£¿ ÓÐËÖªµÀ£¿¶àл¸÷λ£¡£¡ Äãµ½µ×ÊÇÒªÁ¬mysql»¹ÊÇmssql£¿ ÒýÓà ÇëÎÊ ......
1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£ 2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ ) ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......