<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/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>When a Function is indeed a Constant</title><link>http://sqlblog.com/blogs/andrew_kelly/archive/2008/03/01/when-a-function-is-indeed-a-constant.aspx</link><description>In my last blog post: &amp;#160; http://sqlblog.com/blogs/andrew_kelly/archive/2008/02/27/when-getdate-is-not-a-constant.aspx I mentioned that I ran across a situation in which GETDATE() used in a SELECT statement occasionally returned more than 1 value for</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Andrew Kelly : When GETDATE() is not a constant</title><link>http://sqlblog.com/blogs/andrew_kelly/archive/2008/03/01/when-a-function-is-indeed-a-constant.aspx#5384</link><pubDate>Sat, 01 Mar 2008 16:25:40 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:5384</guid><dc:creator>Andrew Kelly : When GETDATE() is not a constant</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://sqlblog.com/blogs/andrew_kelly/archive/2008/02/27/when-getdate-is-not-a-constant.aspx"&gt;http://sqlblog.com/blogs/andrew_kelly/archive/2008/02/27/when-getdate-is-not-a-constant.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: When a Function is indeed a Constant</title><link>http://sqlblog.com/blogs/andrew_kelly/archive/2008/03/01/when-a-function-is-indeed-a-constant.aspx#5407</link><pubDate>Mon, 03 Mar 2008 09:39:27 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:5407</guid><dc:creator>EdVassie</dc:creator><description>&lt;p&gt;I found that Getdate() returned multiple values in a INSERT .. SELECT statement for a number of fix levels in SQL Server 2000. &amp;nbsp;As I needed a consistant time on all rows that were inserted, I just did SET @var = Getdate() before the INSERT, and used @var to provide the required time in the main query.&lt;/p&gt;
</description></item><item><title>re: When a Function is indeed a Constant</title><link>http://sqlblog.com/blogs/andrew_kelly/archive/2008/03/01/when-a-function-is-indeed-a-constant.aspx#5421</link><pubDate>Mon, 03 Mar 2008 20:28:58 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:5421</guid><dc:creator>jerryhung</dc:creator><description>&lt;p&gt;I never thought about this issue until your last blog post&lt;/p&gt;
&lt;p&gt;Luckily, my recent insert of 300,000+ records all share the exact same getdate() value, EVERY TIME (RevisionDate = getdate() inside a transaction)&lt;/p&gt;
&lt;p&gt;However, I have changed my insert code to use a variable instead, to make sure I don't get surprises.&lt;/p&gt;
</description></item><item><title>re: When a Function is indeed a Constant</title><link>http://sqlblog.com/blogs/andrew_kelly/archive/2008/03/01/when-a-function-is-indeed-a-constant.aspx#5759</link><pubDate>Mon, 24 Mar 2008 07:35:15 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:5759</guid><dc:creator>Seraph2047@hotmail.com</dc:creator><description>&lt;p&gt;How To Use MYSQL's &amp;quot;limit&amp;quot; function in Microsoft Sql server?&lt;/p&gt;
&lt;p&gt;for expmple:&lt;/p&gt;
&lt;p&gt;a database have 1,000,000 record,&lt;/p&gt;
&lt;p&gt;I want to read record at order 1000 - 1100.&lt;/p&gt;
&lt;p&gt;in MySQL: &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;Select * from Table1 limit 1000,100&amp;quot; ;&lt;/p&gt;
&lt;p&gt;I serach some blog and technic webpage how to read at mssql,&lt;/p&gt;
&lt;p&gt;in MsSQL: &lt;/p&gt;
&lt;p&gt;&amp;quot;Select * from (Select top 1100 * form Table1 order by DESC) as T1 order by ASC&amp;quot;&lt;/p&gt;
&lt;p&gt;Bnt this expression is too slowly!!! Question: how to optimize? thanks.&lt;/p&gt;
</description></item><item><title>re: When a Function is indeed a Constant</title><link>http://sqlblog.com/blogs/andrew_kelly/archive/2008/03/01/when-a-function-is-indeed-a-constant.aspx#24649</link><pubDate>Thu, 29 Apr 2010 01:31:30 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:24649</guid><dc:creator>JRStern</dc:creator><description>&lt;p&gt;Yup. &amp;nbsp;Just ran into the non-consistent getdate() today my own self, on a (now) retro version of SQL 2005 32-bit:&lt;/p&gt;
&lt;p&gt;Microsoft SQL Server 2005 - 9.00.3282.00 (Intel X86) &lt;/p&gt;
&lt;p&gt;	Aug &amp;nbsp;5 2008 01:01:05 &lt;/p&gt;
&lt;p&gt;	Copyright (c) 1988-2005 Microsoft Corporation&lt;/p&gt;
&lt;p&gt;	Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)&lt;/p&gt;
&lt;p&gt;Thanks for confirminng I'm not crazy - or at least keeping me company!&lt;/p&gt;
</description></item><item><title>Compute Scalars, Expressions and Execution Plan Performance</title><link>http://sqlblog.com/blogs/andrew_kelly/archive/2008/03/01/when-a-function-is-indeed-a-constant.aspx#45012</link><pubDate>Tue, 04 Sep 2012 22:22:29 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:45012</guid><dc:creator>Paul White: Page Free Space</dc:creator><description>&lt;p&gt;The humble Compute Scalar is one of the least well-understood of the execution plan operators, and usually&lt;/p&gt;
</description></item></channel></rss>