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
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?
- In case of select statement I posted earlier
- 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....?