<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Using RAND() in User Defined Functions (UDF)</title>
	<atom:link href="http://blog.sqlauthority.com/2012/11/20/sql-server-using-rand-in-user-defined-functions-udf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2012/11/20/sql-server-using-rand-in-user-defined-functions-udf/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Wed, 19 Jun 2013 21:45:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: chuckpoulsen</title>
		<link>http://blog.sqlauthority.com/2012/11/20/sql-server-using-rand-in-user-defined-functions-udf/#comment-377776</link>
		<dc:creator><![CDATA[chuckpoulsen]]></dc:creator>
		<pubDate>Wed, 21 Nov 2012 01:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21655#comment-377776</guid>
		<description><![CDATA[I am convinced there is a reason for needing udf instead of just using rand() directly.  The request as is doesn&#039;t make much sense.  If a udf is required, maybe consider a CLR if option is available.]]></description>
		<content:encoded><![CDATA[<p>I am convinced there is a reason for needing udf instead of just using rand() directly.  The request as is doesn&#8217;t make much sense.  If a udf is required, maybe consider a CLR if option is available.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumit Gaud</title>
		<link>http://blog.sqlauthority.com/2012/11/20/sql-server-using-rand-in-user-defined-functions-udf/#comment-377128</link>
		<dc:creator><![CDATA[Sumit Gaud]]></dc:creator>
		<pubDate>Tue, 20 Nov 2012 05:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21655#comment-377128</guid>
		<description><![CDATA[go
create function testRand(@rand1 float)
returns bigint
as
begin
-- your logic to manipulate random value
return cast((@rand1*100000) as bigint)
end
go
select dbo.testRand(rand())
--cleanup
drop function dbo.testRand]]></description>
		<content:encoded><![CDATA[<p>go<br />
create function testRand(@rand1 float)<br />
returns bigint<br />
as<br />
begin<br />
&#8211; your logic to manipulate random value<br />
return cast((@rand1*100000) as bigint)<br />
end<br />
go<br />
select dbo.testRand(rand())<br />
&#8211;cleanup<br />
drop function dbo.testRand</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alphonso Jones</title>
		<link>http://blog.sqlauthority.com/2012/11/20/sql-server-using-rand-in-user-defined-functions-udf/#comment-377066</link>
		<dc:creator><![CDATA[Alphonso Jones]]></dc:creator>
		<pubDate>Tue, 20 Nov 2012 02:49:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21655#comment-377066</guid>
		<description><![CDATA[Nevermind, I should learn to read :-)]]></description>
		<content:encoded><![CDATA[<p>Nevermind, I should learn to read :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alphonso Jones</title>
		<link>http://blog.sqlauthority.com/2012/11/20/sql-server-using-rand-in-user-defined-functions-udf/#comment-377062</link>
		<dc:creator><![CDATA[Alphonso Jones]]></dc:creator>
		<pubDate>Tue, 20 Nov 2012 02:38:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21655#comment-377062</guid>
		<description><![CDATA[You can also use a stored procedure with an output parameter:

Create procedure dbo.usp_Randomnumber @Somenumber float OUTPUT 

as 
Begin
	Set @Somenumber = rand()
End
Go


Declare @Number float
Exec dbo.usp_Randomnumber @Number OUTPUT 
Select @Number]]></description>
		<content:encoded><![CDATA[<p>You can also use a stored procedure with an output parameter:</p>
<p>Create procedure dbo.usp_Randomnumber @Somenumber float OUTPUT </p>
<p>as<br />
Begin<br />
	Set @Somenumber = rand()<br />
End<br />
Go</p>
<p>Declare @Number float<br />
Exec dbo.usp_Randomnumber @Number OUTPUT<br />
Select @Number</p>
]]></content:encoded>
	</item>
</channel>
</rss>
