Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetDate() in DTS?

Status
Not open for further replies.

eggy168

Programmer
Mar 6, 2002
220
US
I don't know is it possible or not, but I just want to do a DTS that is copying x rows from Table A to x+1 row to Table B from two different servers. The extra row is a Timestamp feature that indicate the date/time the DTS runs.

I have no problem copying x rows from Table A to x rows to Table B from two different servers. I searched around the online book, I found the GetDate() is the right feature to use. So, I went to the Destination Table, added a new column, As_of with the smalldatetime and the Default Value is GetDate(). Then when I tried to run the DTS again, the DTS worked, but the new column, As_of is having no value.

Is there anyway I can do it in DTS or I need to do something else to make it happens?

Thanks.
 
Set the default value of the column to Getdate().

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the insomniac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Thanks for your quick replied.
I did the Default value of the column to GetDate() already. After running the DTS, the column is still Null. Any suggestions what I did wrong?
Thanks
 
Are they INSERT or UPDATE actions? Are you looking at existing or new records? Set the field not to accept NULLs.
 
Also, you don't have any drop/recreate steps in the package, do you?
 
Hi,
Thanks for the replied. I first tried the GetDate() in the column and it didn't work. Then, I checked the package and found the recreate steps, so I deleted it and now it works no problem. Thanks. Btw, do I have to put the Not Null in the column or just let it be Nulls? It is not a biggie issue now since the package is working fine, but I just want to know in the future.
Anyhow, thanks in million, philhege.
 
You can stipulate the default in your recreation step; that's not a problem. The only question is, do you really have to drop and re-create each time?

I'd make the field NOT NULL with the default. That way, you get meaningful information in the field every time.

Glad to be of help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top