<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comentários em: Microsoft SQL Server data type cast</title>
	<atom:link href="http://blog.pauloasilva.com/microsoft-sql-server-data-type-cast/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pauloasilva.com/microsoft-sql-server-data-type-cast/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 12:23:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Por: PauloASilva</title>
		<link>http://blog.pauloasilva.com/microsoft-sql-server-data-type-cast/comment-page-1/#comment-631</link>
		<dc:creator>PauloASilva</dc:creator>
		<pubDate>Tue, 09 Nov 2010 23:48:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pauloasilva.com/?p=367#comment-631</guid>
		<description>@Marcos: O melhor sempre é consultar a documentação do produto.
Uma pesquisa por SQL Server Data Types vai dar-te muitos resultados válidos, no entanto a documentação do msdn é a melhor (acho até que o melhor que a M$ fez doi o msdn :p)

http://msdn.microsoft.com/en-us/library/ms187752.aspx

Tens aí todos com a respectiva especificação.

Espero ter sido útil.
Cumprimentos.</description>
		<content:encoded><![CDATA[<p>@Marcos: O melhor sempre é consultar a documentação do produto.<br />
Uma pesquisa por SQL Server Data Types vai dar-te muitos resultados válidos, no entanto a documentação do msdn é a melhor (acho até que o melhor que a M$ fez doi o msdn :p)</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms187752.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms187752.aspx</a></p>
<p>Tens aí todos com a respectiva especificação.</p>
<p>Espero ter sido útil.<br />
Cumprimentos.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Marcos</title>
		<link>http://blog.pauloasilva.com/microsoft-sql-server-data-type-cast/comment-page-1/#comment-630</link>
		<dc:creator>Marcos</dc:creator>
		<pubDate>Tue, 09 Nov 2010 17:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pauloasilva.com/?p=367#comment-630</guid>
		<description>Paulo, boa tarde! Sou especialista em Oracle e estou num projeto com SQL Server. Será que você pode me indicar uma boa fonte de pesquisas para os Datatypes do SQL, com indicação de uso, exemplos, etc.? Mto bom seu blog, me ajudou bastante já! Abs</description>
		<content:encoded><![CDATA[<p>Paulo, boa tarde! Sou especialista em Oracle e estou num projeto com SQL Server. Será que você pode me indicar uma boa fonte de pesquisas para os Datatypes do SQL, com indicação de uso, exemplos, etc.? Mto bom seu blog, me ajudou bastante já! Abs</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Paulo A.Silva</title>
		<link>http://blog.pauloasilva.com/microsoft-sql-server-data-type-cast/comment-page-1/#comment-413</link>
		<dc:creator>Paulo A.Silva</dc:creator>
		<pubDate>Fri, 17 Apr 2009 08:49:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pauloasilva.com/?p=367#comment-413</guid>
		<description>&quot;When you use the +, -, *, /, or % arithmetic operators to perform implicit or explicit conversion of int, smallint, tinyint, or bigint constant values to the float, real, decimal or numeric data types, the rules that SQL Server applies when it calculates the data type and precision of the expression results differ depending on whether the query is autoparameterized or not.

Therefore, similar expressions in queries can sometimes produce different results. When a query is not autoparameterized, the constant value is first converted to numeric, whose precision is just large enough to hold the value of the constant, before converting to the specified data type. For example, the constant value 1 is converted to numeric (1, 0), and the constant value 250 is converted to numeric (3, 0).

When a query is autoparameterized, the constant value is always converted to numeric (10, 0) before converting to the final data type. When the / operator is involved, not only can the result type&#039;s precision differ among similar queries, but the result value can differ also. For example, the result value of an autoparameterized query that includes the expression SELECT CAST (1.0 / 7 AS float) will differ from the result value of the same query that is not autoparameterized, because the results of the autoparameterized query will be truncated to fit into the numeric (10, 0) data type. For more information about parameterized queries, see Simple Parameterization[1].&quot;
in http://msdn.microsoft.com/en-us/library/ms187745.aspx

[1]http://msdn.microsoft.com/en-us/library/ms186219.aspx</description>
		<content:encoded><![CDATA[<p>&#8220;When you use the +, -, *, /, or % arithmetic operators to perform implicit or explicit conversion of int, smallint, tinyint, or bigint constant values to the float, real, decimal or numeric data types, the rules that SQL Server applies when it calculates the data type and precision of the expression results differ depending on whether the query is autoparameterized or not.</p>
<p>Therefore, similar expressions in queries can sometimes produce different results. When a query is not autoparameterized, the constant value is first converted to numeric, whose precision is just large enough to hold the value of the constant, before converting to the specified data type. For example, the constant value 1 is converted to numeric (1, 0), and the constant value 250 is converted to numeric (3, 0).</p>
<p>When a query is autoparameterized, the constant value is always converted to numeric (10, 0) before converting to the final data type. When the / operator is involved, not only can the result type&#8217;s precision differ among similar queries, but the result value can differ also. For example, the result value of an autoparameterized query that includes the expression SELECT CAST (1.0 / 7 AS float) will differ from the result value of the same query that is not autoparameterized, because the results of the autoparameterized query will be truncated to fit into the numeric (10, 0) data type. For more information about parameterized queries, see Simple Parameterization[1].&#8221;<br />
in <a href="http://msdn.microsoft.com/en-us/library/ms187745.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms187745.aspx</a></p>
<p>[1]http://msdn.microsoft.com/en-us/library/ms186219.aspx</p>
]]></content:encoded>
	</item>
</channel>
</rss>

