ÔÚ²»Í¬sqlserver·þÎñÆ÷¼ä£¬´´½¨ÏàͬÊý¾Ý¿â¶ÔÏó¡£
·ÖÁ½ÖÖÇé¿ö£º
1¡¢Í¨¹ý½Å±¾·½Ê½£¬2¡¢µ¼Èëµ¼³ö·½Ê½
µ«²»Í¬°æ±¾µÄSqlServer,ÔÚÕâ·½Ãæ²¢²»Ïàͬ¡£
sql2000¶ÔÊý¾Ý¿â¶ÔÏóÖ´ÐÐÉú³É½Å±¾Ê±£¬¾¡¹Ü¶¼Ñ¡Éϸ÷¸öÌõ¼þ£¬µ«¶ÔÓÚ±í¶ÔÏó²¢²»ÄÜ´´½¨Ö÷¼ü
¿ÉÒÔͨ¹ýµ¼Èëµ¼³ö·½Ê½£¬ÔÚµ¼ÈëÄ¿±êÑ¡ÔñÄ¿±êsqlserverºó£¬Ñ¡ÔñÖ»µ¼³ö¶ÔÏó½á¹¹¾ÍºÃÁË¡£
sql2005¶ÔÊý¾Ý¿â¶ÔÏóÖ´ÐÐÉú³É½Å±¾Ê±£¬¿ÉÒÔ´´½¨Ö÷¼ü¡£
¿ÉÊÇËüÔÚµ¼Èëµ¼³öʱ£¬È´Ã»µ¼³öÓГֻ¶ÔÏó½á¹¹”Ñ¡Ïî¡£·´¶øÖ»ÄÜͨ¹ýÉú³É½Å±¾·½Ê½´´½¨ÏàͬµÄ¶ÔÏó¡£
Ïà¹ØÎĵµ£º
ÒÉÎÊ£º
1£¬ sqlserverÀïÃæÖ´ÐÐ xp_cmdshell
exec @error=xp_cmdshell 'cmdstr......'
·µ»ØÖµÊÇʲôֵ£¿dosÃüÁîµÄ´íÎó£¿Ê²Ã´ÑùµÄ´íÎó¿ÉÒÔÆË×½µ½£¿
±ÈÈç:
DECLARE @error int
EXEC @error=master.dbo.xp_cmdshell 'bcp CM_DWHSend.dbo.WK_CM_DWHSend_Master in "D:\Sales\DWH_Onl\2010042_SENDMEMM.csv" -n -t, - ......
/*
*SQLServerÌí¼Ó²Ù×÷ʵÏÖ
*/
void CMFCSQLDlg::OnButton2()
{
// TODO: Add your control notification handler code here
CString strsql;
CString strnum="mynum3";
CString strage="myage3";
HRESULT hResult;
_variant_t RecordsAffected;
CoInitialize(NULL);
_ConnectionPtr m_pAppConn;
hResul ......
ÈçºÎ»ñµÃsqlserverÊý¾Ý¿âÖÐÕ¼ÓøßcpuÓû§µÄ»î¶¯ÄÚÈÝ
1¡¢´Ó΢ÈíÕ¾µãÉÏÏÂÔØqslice_setup.exe
2¡¢´ò¿ªQuery Analyzer£¬ÔËÐÐÒÔÏÂÓï¾ä£º
declare @a int
while (1<2)
begin
select @a=1
end
½«»á·¢ÏÖcpuÂíÉÏ´ïµ½100%
3¡¢´ò¿ªqlice.exe£¬½«·¢ÏÖsqlserver.exeµÄcpuÕ¼ÓÃÂʺܸߣ¬Ë«»÷½øÈ룬³öÐÐsqlserver.exeÖоßÌåÏß³ ......
´¥·¢Æ÷µÄ¶¨ÒåÓë·ÖÀà:
Ö»Òª´¥·¢Æ÷ËùÔÚ±íÉϵĶÔӦʱ¼ä·¢Éú,¾Í»á×Ô¶¯Ö´Ðиô¥·¢Æ÷µÄ´úÂë.ʵ¼ÊÉÏ,ÎÒÃDz¢²»ÄÜÖ±½Óµ÷Óô¥·¢Æ÷,ΨһµÄ·½·¨ÊÇÔÚ·ÖÅäŶ´¥·¢Æ÷µÄ±íÉÏÖ´ÐÐijÖÖÐÐΪ·½¿É¼¤»î´¥·¢Æ÷. [´¥·¢Æ÷ÊÇÒ»ÖÖÌØÊâµÄ´æ´¢¹ý³Ì,ËûÔÚÖ´ÐÐÌض¨µÄÓïÑÔʼþʱÉúЧ
& ......