Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1029679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:34:58+00:00 2026-05-16T12:34:58+00:00

I have SQL Server 2005 Standard Service Pack 2 9.00.4053.00 (Intel X86) Table has

  • 0

I have SQL Server 2005 Standard Service Pack 2 9.00.4053.00 (Intel X86)

Table has close to 30 million rows..

If I do

SELECT GETDATE(), * FROM
<table>

Identical Date and time value is returned including milliseconds part.. though query took more then 3 minutes to complete…

I have already read

http://sqlblog.com/blogs/andrew_kelly/archive/2008/02/27/when-getdate-is-not-a-constant.aspx

http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/66507b8b-4a74-44c1-9637-3ab5f75db6a0

One of the link I posted (marked answer) suggest that prior to SQL 2005 GETDATE was deterministic
although SQL 2000 BOL states GETDATE is nondeterministic

If I do an update with millions of rows

UPDATE tableName
SET dateColumn = GETDATE()

I know you really want to do

DECLARE @DT datetime
SET @DT = GETDATE()
UPDATE table
SET datecol =@DT

I am really confused

What would be expected behavior?

  1. In case of select statement I posted earlier
  2. Behavior of update statement

Considering you are updateing a datecolun on a table with 100 million rows
Would datecolumn will have identical date and time in milliseconds….?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:34:59+00:00Added an answer on May 16, 2026 at 12:34 pm

    Following on from Martin Smith’s answer, The determinism referred to was a change in udf behaviour. In SQL Server 2000, you could not use GETDATE in a udf. You can in SQL Server 2005. See this link too

    As Martin Smith said, some functions are evaluated per column, per query. Not per row. GETDATE is one, RAND is another.

    If you do need row by row evaluation of GETDATE then wrap it in udf.

    Edit:

    NEWID is statistically unique. It must be evaluated row by row so you don’t have the same value appear in another row. Hence the CHECKSUM(NEWID()) trick to generate row by row random numbers…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We installed Service Pack 3 for SQL Server 2005 Standard Edition (64-bit). In the
We have a number of MS SQL Server 2005 installations (both Standard and Enterprise
I have a SQL Server 2005 table like this: create table Taxonomy( CategoryId integer
Software used: Visual studio 2008 professional with services pack 1 Sql Server 2005 Standard
We have SQL Server 2005 running on Win2003/64, and we push it hard. We
I have a SQL Server 2005 database and I have 4 GB of text
I have a SQL Server 2005 database that is suffering from lock starvation because
We have a SQL Server 2005 database, and currently all our users are connecting
I have a SQL Server 2005 database that I'm trying to access as a
I have an SQL Server 2005 server, and I'd like to run a .Net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.