Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
hi guys u are doing great job...i am using BULK INSERT for inserting a huge file in to database..but i am not clear can i specify the datatype in bcp.fmt filecurrent my bcp.fmt file1 SQLCHAR 0 1 "" 1 record_type2 SQLCHAR 0 6 "" 2 serial_numbercan i use some thing like this1 SQLCHAR 0 1 "" 1 record_type2 SQLnumeric 0 6 "" 2 serial_number i.e. use other datatype other than char.. if so howbye
graz
Chief SQLTeam Crack Dealer
4149 Posts
Posted - 2001-11-30 : 09:15:18
Khalik,I've experimented with that but not had much luck. I usually import everything into a table that is all characters. Then I can use SQL to test for valid values using functions such as IsDate and IsNumeric. After than I transfer the data to my main table using INSERT-SELECT statements and lots of CONVERTS. Works wonderfully.===============================================Creating tomorrow's legacy systems today.One crisis at a time.
Arnold Fribble
Yak-finder General
1961 Posts
Posted - 2001-11-30 : 09:36:44
But beware:
SELECT n, IsNumeric(n) FROM ( SELECT '.' n UNION ALL SELECT ',' UNION ALL SELECT '+' UNION ALL SELECT '-' UNION ALL SELECT '$' UNION ALL SELECT '£' UNION ALL SELECT '¥' UNION ALL SELECT '¤' UNION ALL SELECT '$+,.') a