<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlserver.ro/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>Articole</title><link>http://sqlserver.ro/forums/22/ShowForum.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Re: Tipurile Varchar (MAX) si Varbinary (MAX)</title><link>http://sqlserver.ro/forums/thread/360.aspx</link><pubDate>Sat, 14 Oct 2006 08:21:23 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:360</guid><dc:creator>xmldeveloper</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/360.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=22&amp;PostID=360</wfw:commentRss><description>O completare: &lt;a href="http://sqlserver.ro/forums/thread/357.aspx"&gt;http://sqlserver.ro/forums/thread/357.aspx&lt;/a&gt;</description></item><item><title>Tipurile Varchar (MAX) si Varbinary (MAX)</title><link>http://sqlserver.ro/forums/thread/359.aspx</link><pubDate>Sat, 14 Oct 2006 08:20:39 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:359</guid><dc:creator>xmldeveloper</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/359.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=22&amp;PostID=359</wfw:commentRss><description>&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:Arial;"&gt;Tipurile Varchar (MAX) si Varbinary (MAX)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;SQL Server 2005 introduce argumentul &lt;em&gt;&lt;strong&gt;MAX&lt;/strong&gt;&lt;/em&gt; pentru tipurile de date &lt;strong&gt;varchar&lt;/strong&gt;, &lt;strong&gt;nvarchar&lt;/strong&gt; si &lt;strong&gt;varbinary&lt;/strong&gt;. Folosind argumentul &lt;em&gt;&lt;strong&gt;MAX&lt;/strong&gt;&lt;/em&gt; se pot stoca 2^31-1 octeti de date fata de doar 8000 in SQL Server 2000. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;Avantaje:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&lt;/span&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;posibilitatea stocarii datelor de dimensiuni mari fara a folosi tipurile de date &lt;strong&gt;&lt;em&gt;text&lt;/em&gt;,&lt;/strong&gt; &lt;em&gt;&lt;strong&gt;ntext&lt;/strong&gt;&lt;/em&gt; sau &lt;em&gt;&lt;strong&gt;image&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&lt;/span&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;posibilitatea declararii variabilelor de tip &lt;strong&gt;varchar(MAX)&lt;/strong&gt;, &lt;strong&gt;nvarchar(MAX)&lt;/strong&gt; sau &lt;strong&gt;varbinary(MAX)&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&lt;/span&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;posibilitatea folosirii acestor tipuri in cursoare&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&lt;/span&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;folosirea in interiorul unui trigger (coloanele de tip &lt;strong&gt;varchar(MAX)&lt;/strong&gt;, &lt;strong&gt;nvarchar(MAX)&lt;/strong&gt; sau &lt;strong&gt;varbinary(MAX)&lt;/strong&gt; ale unui tabel pot fi regasite in tabelele &lt;em&gt;&lt;strong&gt;inserted&lt;/strong&gt;&lt;/em&gt; si &lt;em&gt;&lt;strong&gt;deleted&lt;/strong&gt;&lt;/em&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&lt;/span&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;se pot face modificari partiale ale datelor de dimensiuni mari folosind clauza &lt;em&gt;&lt;strong&gt;.WRITE&lt;/strong&gt;&lt;/em&gt; a instructiunii &lt;em&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&lt;/span&gt;&lt;span style="font-size:9pt;font-family:Wingdings;"&gt;&lt;span&gt;&lt;span style="font:7pt 'Times New Roman';"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;pot fi folosite functiile pentru siruri de caractere &lt;em&gt;&lt;strong&gt;COL_LENGTH&lt;/strong&gt;&lt;/em&gt;, &lt;em&gt;&lt;strong&gt;CHARINDEX&lt;/strong&gt;&lt;/em&gt;, &lt;em&gt;&lt;strong&gt;PATINDEX&lt;/strong&gt;&lt;/em&gt;, &lt;em&gt;&lt;strong&gt;LEN&lt;/strong&gt;&lt;/em&gt;, &lt;em&gt;&lt;strong&gt;DATALENGTH&lt;/strong&gt;&lt;/em&gt;, &lt;strong&gt;&lt;em&gt;SUBSTRING&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;Exemple:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;-- Exemplul 1&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size:9pt;font-family:Arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;DECLARE @v1 VARCHAR(MAX)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;DECLARE @v2 VARCHAR(MAX)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;SET @v1 = &amp;#39;0123456789&amp;#39;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;SET @v2 = replicate(@v1,10000)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;SELECT datalength(@v2)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;-- rezultatul va fi 100000&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;-- Exemplul 2&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;USE AdventureWorks;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;GO&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;-- inlocuieste 10 caractere &lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;-- &amp;quot;components&amp;quot; devine &amp;quot;features&amp;quot;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;UPDATE Production.Document&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;SET DocumentSummary .WRITE (N&amp;#39;features&amp;#39;,28,10)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-size:8pt;font-family:'Courier New';"&gt;WHERE DocumentID = 3 ;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>