<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#8235;Madeira &#187; שאוליאן חן&#8236;</title>	<atom:link href="http://www.madeira.co.il/author/chen/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.madeira.co.il</link>
	<description>&#8235;SQL Server Services&#8236;</description>	<lastBuildDate>Sat, 19 May 2012 09:04:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>he</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8235;SQL Azure &#8211; What is it ?&#8236;</title>		<link>http://www.madeira.co.il/sql-azure-what-is-it/</link>
		<comments>http://www.madeira.co.il/sql-azure-what-is-it/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 16:14:01 +0000</pubDate>
		<dc:creator>&#8235;שאוליאן חן&#8236;</dc:creator>				<category><![CDATA[בלוגים]]></category>
		<category><![CDATA[כללי]]></category>
		<category><![CDATA[מקודמות]]></category>
		<category><![CDATA[SQL Azure]]></category>

		<guid isPermaLink="false">http://www.madeira.co.il/?p=3789</guid>
		<description><![CDATA[&#8235;So everyone is talking about the next big thing … but what is really the SQL Azure.

SQL Azure provides cloud services to databases that allow you to focus on implementation, rather than build, manage and maintain databases.
This means that you no longer need to deal with installing servers, install the SQL, keep big hard disks, servers and so on … all you need to start working you get from Microsoft and now all that's left to you is to focus on developing.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p><img src='http://www.madeira.co.il/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/3789.jpg&amp;w=214&amp;h=129&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p dir="ltr">So everyone is talking about the next big thing … but what is really the SQL Azure.</p>
<p dir="ltr">SQL Azure provides cloud services to databases that allow you to focus on implementation, rather than build, manage and maintain databases. This means that you no longer need to deal with installing servers, install the SQL, keep big hard disks, servers and so on … all you need to start working you get from Microsoft and now all that's left to you is to focus on developing.</p>
<p dir="ltr">The SQL Azure is part of big family that Microsoft launched on the cloud together with Windows Azure, .NET Services and more.</p>
<p dir="ltr">You can connect to SQL in two ways:</p>
<p dir="ltr">1. By the way we all know and love, through the SSMS.</p>
<p dir="ltr">fiil in the Server name : [server].database.windows.net</p>
<p dir="ltr"><a href="http://www.madeira.co.il/wp-content/uploads/2012/01/sql-connction1.jpg" rel="wp-prettyPhoto[g3789]"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://www.madeira.co.il/wp-content/uploads/2012/01/sql-connction_thumb.jpg" border="0" alt="sql connction" width="362" height="275" /></a></p>
<p dir="ltr">2. Via the SQL Azure portal &#8230; which I will expand in another post.</p>
<p dir="ltr"><a href="http://www.madeira.co.il/wp-content/uploads/2012/01/azure-portal1.jpg" rel="wp-prettyPhoto[g3789]"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://www.madeira.co.il/wp-content/uploads/2012/01/azure-portal_thumb.jpg" border="0" alt="" width="455" height="245" /></a></p>
<p dir="ltr">So let's talk about two important things … we'll start with the price … The payment is only for what you used, when the costs in relation to ownership or hosting on servers, are significantly lower. And the cost is measured in dollars alone per day. The cost is divided into two parts:<br />
1. Payment for the Database</p>
<p dir="ltr">There are two types of editions that you can purchase web edition and business edition:</p>
<p dir="ltr">Web Edition</p>
<p dir="ltr">$9.99 per database up to 1GB per month</p>
<p dir="ltr">$49.95 per database up to 5GB per month</p>
<p dir="ltr">Business Edition</p>
<p dir="ltr">$99.99 per database up to 10GB per month</p>
<p dir="ltr">$199.98 per database up to 20GB per month</p>
<p dir="ltr">$299.97 per database up to 30GB per month</p>
<p dir="ltr">$399.96 per database up to 40GB per month</p>
<p dir="ltr">$499.95 per database up to 50GB per month</p>
<p dir="ltr">for 100GB and 150GB per month, according to reports from Microsoft, the price shall not exceed more than $499.95.</p>
<p dir="ltr">2. Payments for the Traffic to and from the database, when the Traffic in the cloud there is not charge.</p>
<p dir="ltr">To get the cost for the data transfer you can use the following script:</p>
<div style="text-align: left;padding: 4px;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New',courier,monospace;direction: ltr;font-size: 8pt;overflow: auto;cursor: text;border: 1px solid silver">
<div style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible">
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   1:</span> <span style="color: #0000ff">DECLARE</span> @cost_per_mb <span style="color: #0000ff">DECIMAL</span> (3,2)=0.15</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   2:</span> <span style="color: #0000ff">DECLARE</span> @mb <span style="color: #0000ff">INT</span> = 1024*1024;</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   3:</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   4:</span> <span style="color: #0000ff">SELECT</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   5:</span> u.Time_Period,</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   6:</span> u.Direction,</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   7:</span> @cost_per_mb * u.BandwidthInKB/@mb <span style="color: #0000ff">AS</span> [TotalTransferCost]</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   8:</span> <span style="color: #0000ff">FROM</span> (</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">   9:</span>         <span style="color: #0000ff">SELECT</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  10:</span>         Time_Period,</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  11:</span>         Direction,</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  12:</span>         <span style="color: #ff33cc">SUM</span>(Quantity) <span style="color: #0000ff">AS</span> [BandwidthInKB]</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  13:</span>         <span style="color: #0000ff">FROM</span> sys.Bandwidth_Usage u</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  14:</span>         <span style="color: #0000ff">WHERE</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  15:</span>         u.<span style="color: #0000ff">TIME</span> &gt;=<span style="color: #ff33cc">DATEADD</span>(D,0-<span style="color: #ff33cc">DAY</span>(<span style="color: #ff33cc">GetUTCDate</span>()),GetUTCDate())</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  16:</span>         <span style="color: #888888">AND </span>u.<span style="color: #0000ff">TIME</span> &lt;=EOMONTH(<span style="color: #ff33cc">GetUTCDate</span>())</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  17:</span>         <span style="color: #888888">AND </span><span style="color: #000000">class </span>= <span style="color: #ff0000">'External'</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  18:</span>         <span style="color: #888888">AND </span>u.Direction = <span style="color: #ff0000">'Egress'</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  19:</span>         <span style="color: #0000ff">GROUP</span> <span style="color: #0000ff">BY</span> Time_Period, Direction</pre>
<p><!--CRLF--></p>
<pre style="border-style: none;text-align: left;padding: 0px;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New',courier,monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible"><span style="color: #606060">  20:</span>      ) <span style="color: #0000ff">AS</span> u;</pre>
<p><!--CRLF--></p>
</div>
</div>
<p dir="ltr">Well, as you already know, you pay for the size of your database, and you pay for the data transfer. To be cost efficient, you really need to design your database correct to avoid redundant data and you need to stop using SELECT *, or including more columns than you need. Otherwise you’ll pay for an overhead that you actually can avoid.</p>
<p dir="ltr">After we understood the price, let's talk a little about the Availability high that Microsoft is so proud of her&#8230;</p>
<p dir="ltr">Microsoft promises 99.9% of Accessibility and Availability! And for that When you create a Database, in the background created three copies of your DB on different physical server (not virtual) to prevent data loss if a server falls. One replication is called PRIMARY and the others called SECONDARY, the reads and writes replicated the main base and are delivered in a-synchronic to the others, the secondary, if one replication falls another one rises immediately. The information is considered COMMITED only after the data is written to the primary disk (the transaction log reported that the data is written to the disk) and at least to one of the secondary.</p>
<p dir="ltr">That’s it for this time … hope I helped you educate a little bit <img class="wlEmoticon wlEmoticon-smile" style="border-style: none" src="http://www.madeira.co.il/wp-content/uploads/2012/01/wlEmoticon-smile.png" alt="סמיילי" /></p>
</div>]]></content:encoded>			<wfw:commentRss>http://www.madeira.co.il/sql-azure-what-is-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8235;sp_tableoption&#8236;</title>		<link>http://www.madeira.co.il/sp_tableoption/</link>
		<comments>http://www.madeira.co.il/sp_tableoption/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 15:28:36 +0000</pubDate>
		<dc:creator>&#8235;שאוליאן חן&#8236;</dc:creator>				<category><![CDATA[בלוגים]]></category>
		<category><![CDATA[SQL Server 2008 R2]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false">http://www.madeira.co.il/?p=3241</guid>
		<description><![CDATA[&#8235;In this post I'm going to talk about sp_tableoption. It is a set option values for user-defined tables. sp_tableoption can be used to control the behavior of tables with data types like: varchar(max), nvarchar (max), varbinary (max), xml, text, ntext, image, or a column type defined by the user.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p><img src='http://www.madeira.co.il/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/3241.jpg&amp;w=214&amp;h=129&amp;zc=1&amp;ft=jpg' alt='post thumbnail' /></p>
<p dir="ltr">In this post I'm going to talk about sp_tableoption. It is a set option values for user-defined tables. sp_tableoption can be used to control the behavior of tables with data types like: varchar(max), nvarchar (max), varbinary (max), xml, text, ntext, image, or a column type defined by the user.</p>
<p dir="ltr">The syntax of sp_tableoption:</p>
<p dir="ltr"><span style="color: #c0504d">sp_tableoption</span> [ @TableNamePattern = ] <span style="color: #ff0000">'table'</span><br />
, [ @OptionName = ]<span style="color: #ff0000"> 'option_name'</span><br />
, [ @OptionValue = ] <span style="color: #ff0000">'value'</span></p>
<p dir="ltr"><span style="color: #000000">when :</span></p>
<p dir="ltr">[ @TableNamePattern = ] <span style="color: #ff0000">'table'</span> &#8211; means the name of the table that we are going to work on it, with no default (that means that you have to write the table name, you can't leave it NULL)</p>
<p dir="ltr">[ @OptionName = ]<span style="color: #ff0000"> 'option_name'</span> &#8211; means, the name of option you want to run, agian with no default of NULL. <em>option_name</em> can have have different values​​, including:</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="200" valign="top"><span style="color: #2f2f2f"><strong><em><span style="color: #2f2f2f"><strong><em>Value</em></strong></span></em></strong></span></td>
<td width="198" valign="top"><span style="color: #2f2f2f"><strong><em>Description</em></strong></span></td>
</tr>
<tr>
<td width="200" valign="top"><strong><strong>large value types out of row</strong></p>
<p></strong><strong> </strong><strong> </strong><strong> </strong><strong> </strong></td>
<td width="198" valign="top">1 = varchar(max), nvarchar(max), varbinary(max), xml and large user-defined type (UDT) columns in the table are stored out of row, with a 16-byte pointer to the root.</p>
<p>0 = varchar(max), nvarchar(max), varbinary(max), xml and large UDT values are stored directly in the data row, up to a limit of 8000 bytes and as long as the value can fit in the record. If the value does not fit in the record, a pointer is stored in-row and the rest is stored out of row in the LOB storage space. 0 is the default value.</td>
</tr>
<tr>
<td width="200" valign="top"><strong>text in row</strong></td>
<td width="198" valign="top">When OFF or 0 (disabled, the default), it does not change current behavior, and there is no BLOB in row.</p>
<p>When specified and @OptionValue is ON (enabled) or an integer value from 24 through 7000, new text, ntext, or image strings are stored directly in the data row. All existing BLOB (binary large object: text, ntext, or image data) will be changed to text in row format when the BLOB value is updated. For more information, see Remarks.</td>
</tr>
<tr>
<td width="200" valign="top"><strong>table lock on bulk load</strong></td>
<td width="198" valign="top">When disabled (the default), it causes the bulk load process on user-defined tables to obtain row locks. When enabled, it causes the bulk load processes on user-defined tables to obtain a bulk update lock.</td>
</tr>
<tr>
<td width="200" valign="top"><strong>and more …</strong></td>
<td width="198" valign="top"></td>
</tr>
</tbody>
</table>
<p dir="ltr">(In this post I will speak more on <strong>large value types out of row</strong><strong>)</strong></p>
<p dir="ltr"><span>Note: The text in row feature will be removed in a future version of SQL Server. To store large value data, we recommend that you use of the varchar(max), nvarchar(max) andvarbinary(max) data types.</span></p>
<p dir="ltr">[ @OptionValue = ] <span style="color: #ff0000">'value'</span><span style="color: #000000"> – let us to define if the  <span style="color: #ff0000">'option_name'</span> is enabled </span>(<strong>true</strong>, <strong>on</strong>, or<strong> 1</strong>) or disabled (<strong>false</strong>, <strong>off</strong>, or <strong>0</strong>), with no default. For the <strong>text in row</strong> option, valid option values are <strong>0</strong>, <strong>on</strong>, <strong>off</strong>, or an integer from 24 through 7000. When <em>value</em> is <strong>on</strong>, the limit defaults to 256 bytes.</p>
<p dir="ltr">So now let's talk about the <span style="color: #ff0000">'option_name'</span> <strong>large value types out of row.</strong></p>
<p dir="ltr">The option <strong>large value types out of row</strong> deals with large value (As you can tell from the name) or rather say it handles with Large objects (LOB's), These objects are generally used to store large text data and audio/video files. If the LOB size will becomes more than 1 MB then usually store it outside the database. Transact-SQL supports two different ways to specify and access LOBs:</p>
<p dir="ltr">
<p dir="ltr">- Use the data types VARCHAR(MAX), NVARCHAR(MAX), and VARBINARY(MAX)</p>
<p dir="ltr">- Use the so-called text/image data type</p>
<p dir="ltr">When you use MAX by default (instead of an explicit value), the system analyzes the length of the particular string and decides whether to store the string as a convenient value or as a LOB. Although the database system decides how a LOB will be stored, you can override this default specification using the       <strong>sp_tableoption  LARGE_ VALUE_TYPES_OUT_OF_ROW</strong> option.                                If the option's value is set to 1, the data in columns declared using the MAX specifier will be stored separately from all other data. If this option is set to 0, Database Engine stores all values for the row size &lt; 8060 bytes as regular row data.</p>
<pre><span style="color: #0000ff">EXEC</span> <span style="color: #c0504d">sp_tableoption</span> <span style="color: #ff0000">'table'</span>,<span style="color: #ff0000">'LARGE VALUE TYPES OUT OF ROW'</span>,<span style="color: #ff0000">'value'</span></pre>
<p dir="ltr"><strong> </strong></p>
<p dir="ltr">So this is for now… I'll explain on the other <span style="color: #ff0000">'option_name'</span> in my next post.</p>
<p dir="ltr">Chen</p>
</div>]]></content:encoded>			<wfw:commentRss>http://www.madeira.co.il/sp_tableoption/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

