Groups | Blog | Home
all groups > sql server programming > july 2004 >

sql server programming : Assigning the current date to rows..


Andrew J. Kelly
7/7/2004 7:49:49 PM
Try using GETDATE(): SET @MyDate = GETDATE()


--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

sh0t2bts
7/7/2004 11:42:16 PM
Hi,

I am importing data from different tables the table don't have any the
current days date on them or any date that I can use, what I want to do is
assign a date to a field / column for each imported row so that I know what
date the data was imported.

I did try to use the below code but a view would not allow this "I know
relies why" so how could I assign the current date to a columns for each row
I import from the other tables?

DECLARE @MyDate DATETIME
SET @MyDate = { fn CURRENT_DATE() }

Select @MyDate, next_field

Hope this makes sense

Cheers

Mark

sh0t2bts
7/8/2004 12:55:27 AM
Cheers will do!!!

Mark :o)


[quoted text, click to view]

AddThis Social Bookmark Button