<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Aakash Kambuj's blog</title><link>http://blogs.msdn.com/aakashk/default.aspx</link><description>Windows Live Core</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>My blog has moved!</title><link>http://blogs.msdn.com/aakashk/archive/2009/02/18/my-blog-has-moved.aspx</link><pubDate>Thu, 19 Feb 2009 00:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9432645</guid><dc:creator>aakashk</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/aakashk/comments/9432645.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aakashk/commentrss.aspx?PostID=9432645</wfw:commentRss><description>&lt;P&gt;My blog has moved! It now lives at &lt;A href="http://del.icious.info/" mce_href="http://del.icious.info"&gt;http://del.icious.info&lt;/A&gt;.&lt;BR&gt;The focus of the new blog will no longer be SQL Server topics, but a broader discussion of issues encountered when building scalable internet services.&lt;/P&gt;
&lt;P&gt;-Aakash&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9432645" width="1" height="1"&gt;</description></item><item><title>How operator new works</title><link>http://blogs.msdn.com/aakashk/archive/2004/12/02/274035.aspx</link><pubDate>Fri, 03 Dec 2004 00:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:274035</guid><dc:creator>aakashk</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/aakashk/comments/274035.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aakashk/commentrss.aspx?PostID=274035</wfw:commentRss><description>&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I've always been confused about how operator new works. Finally, I found this article which clarifies how the compiler generates code when it encounters new.&lt;br /&gt;&lt;br /&gt;&lt;!--StartFragment --&gt;&lt;/p&gt; &lt;div id="nsbanner"&gt; &lt;div id="bannerrow1"&gt; &lt;table class="bannerparthead" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr id="hdr"&gt; &lt;td class="runninghead" nowrap=""&gt;C++&amp;nbsp;Language&amp;nbsp;Reference&lt;/td&gt; &lt;td class="product" nowrap=""&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;div id="TitleRow"&gt; &lt;h1 class="dtH1"&gt;&lt;a name="_pluslang_how_new_works"&gt;&lt;/a&gt;How new Works&lt;/h1&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--NONSCROLLING BANNER END--&gt; &lt;div id="nstext" valign="bottom"&gt; &lt;div class="saveHistory" id="allHistory" onload="loadAll()" onsave="saveAll()"&gt;&lt;/div&gt;&lt;!-- Topic Status --&gt; &lt;p&gt;The &lt;i&gt;allocation-expression&lt;/i&gt; — the expression containing the &lt;b&gt;new&lt;/b&gt; operator — does three things: &lt;/p&gt; &lt;ul type="disc"&gt; &lt;li&gt;Locates and reserves storage for the object or objects to be allocated. When this stage is complete, the correct amount of storage is allocated, but it is not yet an object.&lt;/li&gt; &lt;li&gt;Initializes the object(s). Once initialization is complete, enough information is present for the allocated storage to be an object.&lt;/li&gt; &lt;li&gt;Returns a pointer to the object(s) of a pointer type derived from &lt;i&gt;new-type-name&lt;/i&gt; or &lt;i&gt;type-name&lt;/i&gt;. The program uses this pointer to access the newly allocated object.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The &lt;b&gt;new&lt;/b&gt; operator invokes the function &lt;b&gt;operator new&lt;/b&gt;. For arrays of any type, and for objects that are not of &lt;b&gt;class&lt;/b&gt;, &lt;b&gt;struct&lt;/b&gt;, or &lt;b&gt;union&lt;/b&gt; types, a global function, &lt;b&gt;::operator new&lt;/b&gt;, is called to allocate storage. Class-type objects can define their own &lt;b&gt;operator new&lt;/b&gt; static member function on a per-class basis.&lt;/p&gt; &lt;p&gt;When the compiler encounters the &lt;b&gt;new&lt;/b&gt; operator to allocate an object of type &lt;i&gt;type&lt;/i&gt;, it issues a call to &lt;i&gt;type&lt;/i&gt;&lt;b&gt;::operator new( sizeof(&lt;/b&gt; &lt;i&gt;type&lt;/i&gt; &lt;b&gt;) )&lt;/b&gt; or, if no user-defined &lt;b&gt;operator new&lt;/b&gt; is defined, &lt;b&gt;::operator new( sizeof(&lt;/b&gt; &lt;i&gt;type&lt;/i&gt; &lt;b&gt;) )&lt;/b&gt;. Therefore, the &lt;b&gt;new&lt;/b&gt; operator can allocate the correct amount of memory for the object.&lt;/p&gt; &lt;blockquote class="dtBlock"&gt;&lt;b class="le"&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;The argument to &lt;b&gt;operator new&lt;/b&gt; is of type &lt;b&gt;size_t&lt;/b&gt;. This type is defined in DIRECT.H, MALLOC.H, MEMORY.H, SEARCH.H, STDDEF.H, STDIO.H, STDLIB.H, STRING.H, and TIME.H.&lt;/blockquote&gt; &lt;p&gt;An option in the grammar allows specification of &lt;i&gt;placement&lt;/i&gt; (see the Grammar for &lt;a href="http://msdn.microsoft.com/library/en-us/vclang/html/_pluslang_new_operator.asp"&gt;new Operator&lt;/a&gt;). The &lt;i&gt;placement&lt;/i&gt; parameter can be used only for user-defined implementations of &lt;b&gt;operator new&lt;/b&gt;; it allows extra information to be passed to &lt;b&gt;operator new&lt;/b&gt;. An expression with a &lt;i&gt;placement&lt;/i&gt; field such as&lt;/p&gt;&lt;pre class="code"&gt;&lt;font size="3"&gt;T *TObject = new ( 0x0040 ) T;&lt;/font&gt;&lt;/pre&gt; &lt;p&gt;is translated to&lt;/p&gt;&lt;pre class="code"&gt;&lt;font size="3"&gt;T *TObject = T::operator new( sizeof( T ), 0x0040 );&lt;/font&gt;&lt;/pre&gt; &lt;p&gt;The original intention of the &lt;i&gt;placement&lt;/i&gt; field was to allow hardware-dependent objects to be allocated at user-specified addresses.&lt;/p&gt; &lt;blockquote class="dtBlock"&gt;&lt;b class="le"&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Although the preceding example shows only one argument in the &lt;i&gt;placement&lt;/i&gt; field, there is no restriction on how many extra arguments can be passed to &lt;b&gt;operator new&lt;/b&gt; this way. &lt;/blockquote&gt; &lt;p&gt;Even when &lt;b&gt;operator new&lt;/b&gt; has been defined for a class type, the global operator can be used by using the form of this example:&lt;/p&gt;&lt;pre class="code"&gt;&lt;font size="3"&gt;T *TObject =::new TObject;&lt;/font&gt;&lt;/pre&gt; &lt;p&gt;The scope-resolution operator (&lt;b&gt;::&lt;/b&gt;) forces use of the global &lt;b&gt;new&lt;/b&gt; operator.&lt;/p&gt;&lt;/div&gt;&lt;/font&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;The&amp;nbsp;original text can be found at &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_pluslang_how_new_works.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_pluslang_how_new_works.asp&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=274035" width="1" height="1"&gt;</description></item><item><title>SQL Server support</title><link>http://blogs.msdn.com/aakashk/archive/2004/09/15/230061.aspx</link><pubDate>Wed, 15 Sep 2004 18:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:230061</guid><dc:creator>aakashk</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/aakashk/comments/230061.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aakashk/commentrss.aspx?PostID=230061</wfw:commentRss><description>&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I have gotten a number of emails from people through my blog, asking various questions about SQL Server 2000 and SQL Server 2005. While I appreciate getting these questions, please note that the best place for SQL Server support is the SQL Server newsgroups, where the presence of hundreds of extremely knowledgeable people will ensure you get a rapid response to your queries.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;The SQL Server 2000 newsgroups are located on the NNTP server &lt;font color="#800080"&gt;msnews.microsoft.com&lt;/font&gt;. You will need a newsreader like Outlook Express to browse and post on the newsgroups. The SQL Server folders are in the &lt;font color="#800080"&gt;microsoft.public.sqlserver.*&lt;/font&gt; hierarchy.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;For SQL Server 2005 Beta support issues, visit the SQL Server 2005 newsgroups at &lt;/font&gt;&lt;a title="http" href="http://communities.microsoft.com/newsgroups/default.asp?icp=sqlserver2005&amp;amp;slcid=us"&gt;&lt;font face="Verdana" size="2"&gt;http://communities.microsoft.com/newsgroups/default.asp?icp=sqlserver2005&amp;amp;slcid=us&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp; [thanks j0ey]&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=230061" width="1" height="1"&gt;</description></item><item><title>datetime quirks</title><link>http://blogs.msdn.com/aakashk/archive/2004/09/14/229667.aspx</link><pubDate>Tue, 14 Sep 2004 23:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:229667</guid><dc:creator>aakashk</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/aakashk/comments/229667.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aakashk/commentrss.aspx?PostID=229667</wfw:commentRss><description>&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Datetime and smalldatetime data types can be confusing at times.&lt;br /&gt;For example, consider&amp;nbsp;the following select statement:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;create table t1(c1 datetime)&lt;br /&gt;go&lt;br /&gt;insert t1 values('20010101')&lt;br /&gt;go&lt;/font&gt;&lt;font face="Verdana" size="2"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font face="Verdana" size="2"&gt;select&amp;nbsp;c1 + '1/1/3' from t1&lt;br /&gt;go&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;If you expected '1/1/3' to represent january 1, 3AD, you're in for a little surprise.&lt;br /&gt;&lt;/font&gt;&lt;font face="Verdana" size="2"&gt;This addition of a string to a datetime produces the following result:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" color="#ff0000" size="2"&gt;2104-01-02 00:00:00.000&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;font face="Verdana" size="2"&gt;This happens because SQL Server treats '1/1/3' as '1/1/2003'. Then it calculates the difference in days between '1/1/2003' and '1/1/1900', and adds the numbers of days to the value stored in c1. This happens because January 1, 1900 is treated as the base date in SQL Server 2000 and SQL Server 2005.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=229667" width="1" height="1"&gt;</description></item><item><title>Tell me about your experience with Browse mode</title><link>http://blogs.msdn.com/aakashk/archive/2004/09/06/226215.aspx</link><pubDate>Tue, 07 Sep 2004 02:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:226215</guid><dc:creator>aakashk</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/aakashk/comments/226215.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aakashk/commentrss.aspx?PostID=226215</wfw:commentRss><description>&lt;div&gt;&lt;span class="763374902-07092004"&gt;&lt;font face="Verdana" size="2"&gt;I'd like to get a feel of how many of you out there are using Browse mode (appending FOR BROWSE to your SELECT statements, and then using the additional key column metadata returned in order to update the table) directly in your applications in SQL 2000. What kind of applications are you using them in - scripted stuff like websites/ecommerce, or in the middle tier/for backend updates?&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="763374902-07092004"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span class="763374902-07092004"&gt;&lt;font face="Verdana" size="2"&gt;I would appreciate your feedback/comments about Browse mode posted as comments to this blog - what you think is good about it, what you would like improved, and whether the currently available information on the subject is sufficient/non-existent.&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="763374902-07092004"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span class="763374902-07092004"&gt;&lt;font face="Verdana" size="2"&gt;If you would like any questions about Browse mode answered, feel free to post them to either the SQL 2000 or SQL 2005 newsgroups, or &lt;A href="http://blogs.msdn.com/aakashk/contact.aspx"&gt;contact me&lt;/a&gt;.&lt;br /&gt; &lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="763374902-07092004"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span class="763374902-07092004"&gt;&lt;font face="Verdana" size="2"&gt;Meanwhile, that promised Browse mode article is coming :)&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=226215" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/aakashk/archive/tags/Browse+Mode/default.aspx">Browse Mode</category></item><item><title>Talking about SQL server topics</title><link>http://blogs.msdn.com/aakashk/archive/2004/08/30/222789.aspx</link><pubDate>Mon, 30 Aug 2004 21:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:222789</guid><dc:creator>aakashk</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/aakashk/comments/222789.aspx</comments><wfw:commentRss>http://blogs.msdn.com/aakashk/commentrss.aspx?PostID=222789</wfw:commentRss><description>&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Hi all,&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;My name is Aakash Kambuj, and I'm a developer on the SQL Server team, working on SQL Server 2005. Over the next few weeks, I'm going to be writing about some of the more esoteric features of SQL Server and Transact-SQL, like FOR BROWSE and Bulk Insert, and how their behaviour is improved in SQL Server 2005. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;So stay tuned!&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;-Aakash&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=222789" width="1" height="1"&gt;</description></item></channel></rss>