Encounter an error upon attempting to create a format file.
Context: Have a very large comma delimited file that has over 1.3 million records. Upon opening the file with EmEditor, I delete the
comment line that is on the very last record.
Due to a comma within one of the fields, it appears best that I use a format file to enable a bulk insert of the entire file into the associated yearly tables within the Sql Server 2012 database. For exammple, EquipSales_2013, EquipSales_2014, and so on.
Upon copy pasting the following line at the command prompt, I encounter an error, as displayed below as well.
[Bold]
C:\Users\WillCa>bcp Equipment.dbo.EquipSales_2013 format nul -c -f C:\EquipData\EquipSales_2013.fmt -t, -T
[/Bold]
I did verify the following but still not able to create the format file.
Step 1: Check to ensure tha SQL Services are running Yes.
There appears to be the instance for Sql Server 2012 and also for Sql Express.
Step 2: Check that I am indeed using the correct Sql Server instance name - INSTANCE2 Yes.
Step 3: checked that I can find the SQL Server using sqlcmd -L at command prompt. Yes.
Step 4: Checked that allow remote connections to this server is enabled. Yes.
Any insight as to how I resolve the error?
Context: Have a very large comma delimited file that has over 1.3 million records. Upon opening the file with EmEditor, I delete the
comment line that is on the very last record.
Due to a comma within one of the fields, it appears best that I use a format file to enable a bulk insert of the entire file into the associated yearly tables within the Sql Server 2012 database. For exammple, EquipSales_2013, EquipSales_2014, and so on.
Upon copy pasting the following line at the command prompt, I encounter an error, as displayed below as well.
[Bold]
C:\Users\WillCa>bcp Equipment.dbo.EquipSales_2013 format nul -c -f C:\EquipData\EquipSales_2013.fmt -t, -T
[/Bold]
Code:
SQLState = 08001, NativeError = 2
Error = [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [2].
SQLState = 08001, NativeError = 2
Error = [Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-
specific error has occurred while establishing a connection to SQL Server.
Server is not found or not accessible. Check if instance name is correct and if SQL S
erver is configured to allow remote connections.
For more information see SQL Server Books Online.
SQLState = S1T00, NativeError = 0
Error = [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired
I did verify the following but still not able to create the format file.
Step 1: Check to ensure tha SQL Services are running Yes.
There appears to be the instance for Sql Server 2012 and also for Sql Express.
Step 2: Check that I am indeed using the correct Sql Server instance name - INSTANCE2 Yes.
Step 3: checked that I can find the SQL Server using sqlcmd -L at command prompt. Yes.
Step 4: Checked that allow remote connections to this server is enabled. Yes.
Any insight as to how I resolve the error?