I have an SSDT 2014 SQL Server Database Project in Visual Studio 2013. It targets Sql Server 2008. There is a stored procedure which has a bulk insert statement in it. The statement is absolutely valid, but SSDT reports error SQL46010 - Incorrect syntax.
The statement is:
BULK INSERT #tmp
FROM 'C:\Imports\BulkyFile.txt'
WITH (FIRSTROW = 2, FIELDTERMINATOR = '|', KEEPNULLS, ROWTERMINATOR = '\n', CODEPAGE='850')
Apparently SSDT thinks '850' is not a valid. If I change the codepage to 'ACP' all is well:
BULK INSERT #tmp
FROM 'C:\Imports\BulkyFile.txt'
WITH (FIRSTROW = 2, FIELDTERMINATOR = '|', KEEPNULLS, ROWTERMINATOR = '\n', CODEPAGE='ACP')
Is there a setting or something for SSDT, so that it will except a number for the CODEPAGE? See also https://msdn.microsoft.com/en-us/library/ms188365.aspx.
RAWto read the text unconverted. This will work if your server's (actually, column's) collation is one of theLatincollations - Panagiotis Kanavos