锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 鏈榪戞洿鎹㈠紑鍙戞満鐨勭幆澧?浠嶹indows XP鎹㈠埌Windows 7錛岀粨鏋滀互鍓嶅湪XP涓嬬殑涓涓猇S2008鐨勪竴涓彃浠墮」鐩湪鏂扮幆澧冧腑緙栬瘧鑰佹槸鍑洪敊錛?/p> 鍦ㄧ綉涓婃悳绱簡涓鐣紝緇堜簬鎵懼埌涓綃囨枃绔犱粙緇嶇殑瑙e喅鏂規錛?/p> 榪愯Vs2008 SDK-銆塗ools-銆塕eset the Microsoft Visual Studio 2008 SP1 Experimental hive 鐒跺悗閲嶆柊緙栬瘧灝監K浜嗐?/p>#include "stdafx.h"
#include "gmock/gmock-actions.h"
using namespace testing;
class Calculate
{
public:
Calculate(){}
long add(long a,long b){return a+b;}
};
class CalculateMock:public Calculate
{
public:
CalculateMock():Calculate(){}
MOCK_METHOD2(add,long(long a,long b));
};
long testFun(Calculate& cal)
{
return cal.add(2,3);
}
TEST(testMock,testAdd)
{
CalculateMock obj;
long len = 10;
ON_CALL(obj,add(2,3)).WillByDefault(Return(len));
EXPECT_CALL(obj,add(2,3)).Times(1);
//obj.add(2,3);
EXPECT_EQ(10, obj.add(2,3));
}
int _tmain(int argc, _TCHAR* argv[])
{
testing::InitGoogleMock(&argc, argv);
RUN_ALL_TESTS();
return 0;
}
鍋氱涓涓猟emo闇瑕佹敞鎰忕殑浜嬮」錛?br />1. 灝嗙敤鍒扮殑gtest,gmock,鍜屼綘鑷繁榪愮敤鐨刾roject鐢ㄥ悓鏍風殑code generation 鐨勫艦寮忎竴鑷?灝?project property->C++->Code Generation: 璁劇疆涓猴細Multi-threaded Debug(/MTd)
2. 娣誨姞 using namespace testing, 鍚﹀垯浼氬嚭鐜?#8216;Return’Identifier not found.榪欐牱鐨勯敊璇?br />
So excited to make it work after so much confusion, anxiety.
Fighting!!
]]>Failed to retrieve paths under VSTemplate for the specified registry hive
]]>Build鍙紪璇戝伐紼嬩腑涓婃淇敼榪囩殑鏂囦歡錛屽茍閾炬帴紼嬪簭鐢熸垚鍙墽琛屾枃浠躲?/pre>
1. 鍦ㄧ數鑴戜笂create folder錛屽懡鍚嶄負demo.
2.閫変腑demo銆傚湪鑿滃崟涓夋嫨git clone.
灝卞彲浠heckout涓嬫潵浠g爜銆?/div>
]]>
set of rows ,rather than performing single row-by-row processing.
濡傛灉浣犵殑紼嬪簭閲屼竴瀹氳涓鏉′竴鏉$殑鎵ц錛岄偅涔堜竴瀹氳鍏堣冭檻浣跨敤濡倃hile寰幆錛屽瓙鏌ヨ錛?br /> 涓存椂琛紝琛ㄥ彉閲忕瓑絳夛紝濡傛灉榪欎簺閮戒笉鑳芥弧瓚寵姹傦紝鍦ㄨ冭檻浣跨敤娓告爣銆?br />
T-SQL涓父鏍囩殑鐢熷瓨鍛ㄦ湡錛?br /> 1.鐢ㄨ繑鍥炰竴涓湁鏁堢粨鏋滈泦鐨剆ql璇彞鏉ュ畾涔変竴涓父鏍囥?br /> a cursor is defined via a SQL statement that returns a valid result set.
2. 鎵撳紑娓告爣
3. 涓鏃︽父鏍囪鎵撳紑灝卞彲浠ヤ粠娓告爣涓瘡嬈″彇鍑轟竴琛屾暟鎹紝瑕佹牴鎹父鏍囩殑瀹氫箟鍙互鍚戝墠鍘繪暟鎹垨
鍚戝悗鍙栨暟鎹?br /> the rows can be fetched moving forword or backword ,depending on the original cursor definition.
4. 鏍規嵁娓告爣鐨勭被鍨嬶紝鏁版嵁鍙互琚慨鏀規垨鑰呭彧鑳借銆?br /> 5.鏈鍚庯紝鐢ㄥ畬娓告爣鍚庯紝蹇呴』琚樉紺虹殑鍏抽棴錛屽茍涓斾粠鍐呭瓨涓Щ闄ゃ?br />
娓告爣瀹氫箟鏍煎紡錛?br /> declare cursor_name cursor
[local|global]
[forword_only|scroll]
[static|keyset|dynamic|fast_forword]
[read_only| scroll_locks|optimistic]
[type_warning]
for select_statement[for update [of column[,...]]]
The select_statement argument is the query used to define the data within the cursor. Avoid
using a query that hasmore columns and rows than will actually be used, because cursors, while
open, are kept inmemory. The UPDATE [OF column_name [,...n]] is used to specify those columns
that are allowed to be updated by the cursor.
]]>
1.case鍑芥暟浠ヤ竴涓〃杈懼紡浣滀負杈撳叆錛屼竴涓間綔涓鴻緭鍑?br />鏍煎紡錛歝ase 鍚庨潰鏈夎緭鍏ヨ〃杈懼紡錛寃hen鍚庨潰鐨勭殑姣忎竴涓〃杈懼紡閮戒細鍜宑ase鍚庨潰鐨勮緭鍏ヨ〃杈懼紡榪涜姣旇緝榪愮畻
濡傛灉鐩哥瓑錛屽垯榪斿洖錛屽惁鍒欒繑鍥瀍lse鍚庨潰鐨勮〃杈懼紡錛屽鏋滄病鏈塭lse鍒欒繑鍥濶ULL銆?br />case input_expression
when when_expression then result_expression
[...n]
[else else_result_expression]
end
case鐨勭浜岀鎯呭喌錛?br />case鍚庨潰娌℃湁琛ㄨ揪寮忥紝when鍚庨潰璺熺殑鏄痓ool琛ㄨ揪寮忋傝繑鍥炵涓涓獁hen鍚庨潰璁$畻涓簍rue鐨勮〃杈懼紡
鏍煎紡涓猴細
case
when bool_expression then result_expression
[...n]
else result_expression
end
2. if....else...鐨勬牸寮?br />if bool_expression
{sql_statement|sql_block}
[else
{sql_statement|sql_block}
]
3.begin ....end 鐩稿綋浜巆++涓殑{...}鐢ㄦ潵褰㈡垚涓涓唬鐮佸潡
4.鏉′歡寰幆
return,while,goto,waitfor
return
return 鐢ㄤ簬緇撴潫褰撳墠鐨剆ql鍧?鏌ヨ錛屽瓨鍌ㄨ繃紼嬨?br />綾諱技浜巆++涓殑return銆?br />return 鍙互榪斿洖涓涓暟瀛?/p>
while 綾諱技c++涓殑while錛屽悓鏍鋒敮鎸乥reak錛宑ontinue錛宐reak鏉ョ粨鏉熷綋鍓嶅唴灞傚驚鐜紝continue緇х畫褰撳墠寰幆
waitfor鏍煎紡
waitfor
delay 'time_to_pass'//鎵ц鍓嶇瓑寰呯殑鏃墮棿錛氭牸寮忎負00:00:00灝忔椂錛氬垎閽燂細縐?br /> |time 'time_to_execute'//璁劇疆瀹為檯鎵ц鐨勬椂闂?br /> |錛坮eceive_statement錛塠,TimeOUT timeout]
鍙互鍒╃敤waitfor灝嗘煇浜涘鏉傜殑鎵ц璁懼畾涓哄湪鐩稿絀洪棽鐨勬椂闂村唴榪涜銆?/p>
SQL Server 瀵規暟鎹被鍨嬩嬌鐢ㄤ互涓嬩紭鍏堢駭欏哄簭錛?/p>
鐢ㄦ埛瀹氫箟鏁版嵁綾誨瀷錛堟渶楂橈級
sql_variant
xml
datetimeoffset
datetime2
datetime
smalldatetime
date
time
float
real
decimal
money
smallmoney
bigint
int
smallint
tinyint
bit
ntext
text
image
timestamp
uniqueidentifier
nvarchar錛堝寘鎷?nvarchar(max)錛?/p>
nchar
varchar錛堝寘鎷?varchar(max)錛?/p>
char
varbinary錛堝寘鎷?varbinary(max)錛?/p>
binary錛堟渶浣庯級
Returns strDest. No return value is reserved to indicate an error.
涓嶈兘淇濊瘉NULL緇撴潫錛屽皢count涓瓧絎︽嫹璐濆埌strDest涓?/p>
ostream& operator<<(ostream& os,const CString& str)
{
long multiBytes = WideCharToMultiByte(CP_ACP,0,str._pData,-1,NULL,0,NULL,NULL);//鑾峰緱灝嗗瀛楄妭杞崲鎴愬鑷繁鏃訛紝鎵闇瑕佺殑瀛楄妭涓暟錛?/span>娉ㄦ剰钃濊壊閮ㄥ垎
char *lpMultiBytes = new char[multiBytes+10];//鍒嗛厤澶氬瓧鑺傛椂鎵闇瑕佺殑鍐呭瓨
memset(lpMultiBytes,0,multiBytes+10);
WideCharToMultiByte(CP_ACP,0,str._pData,-1,lpMultiBytes,multiBytes+10,NULL,NULL);//璋冪敤win32api鍑芥暟灝嗗瀛楄妭鐨勮〃紺鴻漿鎹㈡垚涓哄瀛楄妭鐨勮〃紺猴紝娉ㄦ剰钃濊壊閮ㄥ垎
os<<lpMultiBytes;
return os;//娉ㄦ剰榪斿洖鍊?br />}