import text files with empty field and date | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

import text files with empty field and date

i have a text file i want to import to a db
where i have problems with the columns that have
1)default value – like getdate() – whci h iwant it to be activated when i enter an empty field
2)when i try to insert a time to a datetime col i recivev error
(i tried to insert 25/12/2005 and 12/25/2005 and nothing helped!)
any idea?
thnaks in advance
peleg
What error did you get?
Have a look at SET DATEFORMAT in BOL before you do the INSERT. Also, you might want to use an independant and safe format like 20051227 for the import. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs

]]>