bulkinsert - SQL Server Bulk Import - character translation? -


i have pipe delimited text file using bulk insert import table in sql server.

i have had real problems characters. example, text appears in text file "30º of tilt , 80º" gets imported "30┬║ of tilt , 80┬║"

now, data in text file generated sql server database, , in original table string appears "30º of tilt , 80º" i'm baffled.

both databases have same collation. sp use bulk insert is:

declare @sql nvarchar(4000) = 'bulk insert ' + @temptable + ' '''+@sourcefile+''' (fieldterminator=''|'',rowterminator=''\n'');' exec(@sql) 

which works fine in other respects

thanks

assuming @sourcefile ansi encoded, should work:

declare @sql nvarchar(4000) = 'bulk insert ' + @temptable + ' '''+@sourcefile+''' (fieldterminator=''|'',rowterminator=''\n'', codepage=''acp'');' exec(@sql) 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -