<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" media="screen" href="/App_Themes/default/rss.xslt"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:evnet="http://www.mscommunities.com/rssmodule/"><channel><title>Comment Feed for MS SQL : nvarchar(max) vs nvarchar(SIZE) (TechOff on Channel 9)</title><atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/forums/techoff/444820-ms-sql--nvarcharmax-vs-nvarcharsize/rss/default.aspx" /><image><url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url><title>Comment Feed for MS SQL : nvarchar(max) vs nvarchar(SIZE) (TechOff on Channel 9)</title><link>http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/</link></image><description>MS SQL : nvarchar(max) vs nvarchar(SIZE)</description><link>http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/</link><language>en-us</language><pubDate>Mon, 24 Nov 2008 15:44:15 GMT</pubDate><lastBuildDate>Mon, 24 Nov 2008 15:44:15 GMT</lastBuildDate><generator>EvNet (EvNet, Version=1.0.3599.6114, Culture=neutral, PublicKeyToken=null)</generator><item><title>Re: Re: Re: MS SQL : nvarchar(max) vs nvarchar(SIZE)</title><description>&lt;P&gt;VARCHAR in sql is like string in .net &lt;BR&gt;N means National Text / Unicode&lt;BR&gt;&lt;BR&gt;CHAR or NCHAR are an "Array of"&lt;BR&gt;&lt;BR&gt;if you have the text "ABC"&amp;nbsp; in you have a varchar(8)&amp;nbsp; you get back "ABC"&lt;BR&gt;if you use char(8) you get back "ABC______"&amp;nbsp; ie filled with spaces to 8 chars&lt;BR&gt;&lt;BR&gt;when sql creates storage for varchar it has to use a method that manages blocks of text and pointers from the data row to the block.&lt;BR&gt;it also has to do lenght plus text in building an index on varchar.&lt;BR&gt;fixed text (char)&amp;nbsp; always fits a given size and is simpler for sql to manage.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So yes turrican sql does know, and does what it can with it... but a string is a string.&lt;/P&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=445156</link><pubDate>Mon, 24 Nov 2008 15:44:15 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=445156</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/445156/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>VARCHAR in sql is like string in .net N means National Text / UnicodeCHAR or NCHAR are an "Array of"if you have the text "ABC"&amp;nbsp; in you have a varchar(8)&amp;nbsp; you get back "ABC"if you use char(8) you get back "ABC______"&amp;nbsp; ie filled with spaces to 8 charswhen sql creates storage for varchar&amp;#8230;</evnet:previewtext><dc:creator>figuerres</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/445156/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: MS SQL : nvarchar(max) vs nvarchar(SIZE)</title><description>The only difference is the length. AFAIK (n)varchar are stored external of the table and the space for it is allocated as required. Now if you want to limit the size use size &amp;lt; MAX otherwise use MAX. Btw. MAX is also limiting to a concrete value.</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=444893</link><pubDate>Sun, 23 Nov 2008 15:01:39 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=444893</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/444893/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>The only difference is the length. AFAIK (n)varchar are stored external of the table and the space for it is allocated as required. Now if you want to limit the size use size &amp;lt; MAX otherwise use MAX. Btw. MAX is also limiting to a concrete value.</evnet:previewtext><dc:creator>Christian Liensberger</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/444893/Trackback.aspx</trackback:ping></item><item><title>Re: Re: MS SQL : nvarchar(max) vs nvarchar(SIZE)</title><description>*lol* ok... I'll try to ask this in a pure SQL forum I guess. Would be very nice if MSSQL knew this or altered it automtically, like when it gets above a certain size it'll know "ok, this is a big text chunk, let us optimize the field for it."</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=444835</link><pubDate>Sun, 23 Nov 2008 10:15:39 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=444835</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/444835/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>*lol* ok... I'll try to ask this in a pure SQL forum I guess. Would be very nice if MSSQL knew this or altered it automtically, like when it gets above a certain size it'll know "ok, this is a big text chunk, let us optimize the field for it."</evnet:previewtext><dc:creator>turrican</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/444835/Trackback.aspx</trackback:ping></item><item><title>Re: MS SQL : nvarchar(max) vs nvarchar(SIZE)</title><description>&lt;p&gt;If the maximum size is known and you're 100% certain it will NEVER change, &lt;em&gt;I think&lt;/em&gt; NVARCHAR(size) is good. It makes it very explicit. If you're not sure what you should pick as a maximum size (like your example of the forum signature), &lt;em&gt;I think&lt;/em&gt; NVARCHAR(MAX) is better.&lt;/p&gt;
&lt;p&gt;Disclaimer: the opinions posted in this message are my personal opinion and should not be taken as expert advice. ;-)&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=444833</link><pubDate>Sun, 23 Nov 2008 10:13:02 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/444820-MS-SQL--nvarcharmax-vs-nvarcharSIZE/?CommentID=444833</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/444833/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>If the maximum size is known and you're 100% certain it will NEVER change, I think NVARCHAR(size) is good. It makes it very explicit. If you're not sure what you should pick as a maximum size (like your example of the forum signature), I think NVARCHAR(MAX) is better.
Disclaimer: the opinions&amp;#8230;</evnet:previewtext><dc:creator>Tommy Carlier</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/444833/Trackback.aspx</trackback:ping></item></channel></rss>