Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 OLE DB Transformations and Column DEFAULTS

Author  Topic 

MuadDBA

628 Posts

Posted - 2007-07-02 : 16:00:03
I have a column which uses a DEFAULT as GETDATE in one of my tables. When I execute a DTS package to insert data into it, the column values are all the same, but if I use SSIS, the dates differ slightly (by a few ticks after several rows, but not a consistent amount of rows).

Is there an explanation for this difference, and how can I correct this problem?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-07-02 : 16:15:37
The difference is probably in how the program is inserting the data. Perhaps one is using bulk insert so it is doing the data in batches, hence the datetime being the same. If you want all rows to have the same value and not use getdate() to represent when it actually got inserted, then save the value to a variable, then update the data at the end.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

MuadDBA

628 Posts

Posted - 2007-07-02 : 16:40:59
I ended up using a derived column to do this, but it is still annoying.

Thanks Tara.
Go to Top of Page
   

- Advertisement -