Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Southern California

    Unanswered: INSERT with SELECT and getdate()

    I have a table which I want to load with a select statement. One of the columns in the target table contains the insert datetime. If I use getdate() in the select statement, will the value for that column be different for some of the rows if the query runs for a couple seconds, or will getdate() work like a subquery and use the same value for all rows inserted with that one execution of the INSERT/select statement?

  2. #2
    Join Date
    Dec 2003
    getdate() runs once at the beginning of the query and is inserted as a constant for all of your subsequent rows.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts