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.
| Author |
Topic |
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2003-09-04 : 23:50:53
|
| I just receive a DTS job assigned from my boss. I faced a problem as the SQL server rejects all values it cannot recognize as dates (including dates earlier than January 1, 1753). Normally, no values in the data source should be so 'old' days but the input program didn't validate the input date. Anyone can give me some suggestions in handling this? |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-09-05 : 05:31:25
|
| You can point to a query (as the data source) instead ofpointing to e.g. Excel sheet itself:select * from [Sheet1$] where IsDate(yourDateColumnName) |
 |
|
|
yipchunyu
Yak Posting Veteran
80 Posts |
Posted - 2003-09-09 : 04:02:51
|
| two problems:1. with this approach, yes, it can import the data but i can't figure out the execption case.2. the data source is text file and i don't know it works or not (i needs lots of programming work to modfity the code even it works)Anyway, thx a lot for your help. |
 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-09-09 : 05:43:22
|
yip, are you transferring data using DTS directly into the final table? You could import all the data first into an intermediary or "staging" table which has no constraints on it. Then you could use a query to transfer all the valid data into your final table. At the end of the job you will have all the data still present in the staging table, so you can take a look at the kind of data you've been getting. You could also run a query to delete all the data that has been transferred successfully, so you'll be left with the exceptions in the staging table.Owais Make it idiot proof and someone will make a better idiot |
 |
|
|
|
|
|