Posted by newtophp2000 on 12/28/05 15:48
David Portas wrote:
> You say BCP isn't an option but you didn't explain what other method
> you are using to read the file or why a cursor is necessary. Don't rely
> on SET DATEFORMAT. Use the CONVERT function with the style parameter to
> specify the exact format. Looks like style 3 or 103 is what you need.
I read from the file line by line and parse the line to extract the
fields. I then use the bound variables in the prepared Insert
statement to add it to the database. I wanted to change the DATEFORMAT
configuration as it seemed to be such a straight answer. I guess I
could use the CONVERT function if it is fast enough. I can do some
tests to see how it performs.
I am curius: is there a particular reason to shy away from setting
DATEFORMAT? Is it not reliable as implemented or something else?
Thanks a lot!
> --
> David Portas
> SQL Server MVP
> --
[Back to original message]
|