SQL Server import data - sql-server

When I'm trying to import data from a flat file (text file) to SQL Server, I get some errors:
Validating (Error)
Messages
Error 0xc00470b6: Data Flow Task 1: The LocaleID 1 is not installed on this system.
(SQL Server Import and Export Wizard)
Error 0xc004706b: Data Flow Task 1: "Source - student_TXT" failed validation and returned validation status "VS_ISBROKEN".
(SQL Server Import and Export Wizard)
Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
(SQL Server Import and Export Wizard)
Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
(SQL Server Import and Export Wizard)
Help please

When using variable names you can set the setting delay validation to true. That will solve one of your issues. If you could tell us more about what localeid1 is, perhaps we could help you further?

Related

SSMS can't open data file

Im trying to import a .csv file in SQL Server Management Studio using the import export wizard.
I just created a database and when I used the wizard I ran into several errors. This is the error log.
Pre-execute (Error)
Messages
Information 0x402090dc: Data Flow Task 1: The processing of file "G:\SLIIT\3 YEAR\2 SEM\DWBI\assignment\datasource\steam_description_data.csv" has started.
(SQL Server Import and Export Wizard)
Information 0x402090dc: Data Flow Task 1: The processing of file "G:\SLIIT\3 YEAR\2 SEM\DWBI\assignment\datasource\steam_description_data.csv" has started.
(SQL Server Import and Export Wizard)
Warning 0x80070020: Data Flow Task 1: The process cannot access the file because it is being used by another process.
(SQL Server Import and Export Wizard)
Error 0xc020200e: Data Flow Task 1: Cannot open the datafile "G:\SLIIT\3 YEAR\2 SEM\DWBI\assignment\datasource\steam_description_data.csv".
(SQL Server Import and Export Wizard)
Error 0xc004701a: Data Flow Task 1: Source - steam_description_data_csv failed the pre-execute phase and returned error code 0xC020200E.
(SQL Server Import and Export Wizard)
I don't have the file open with any other programs so i'm unsure why it even said it was being used by another program.
any way to fix this?

SQL Server import and export wizard - change concurrent setting

I am trying to export several (~40) tables using the SQL Server import and export wizard (Right click database -> Task -> Export Wizard).
The wizard allows me to export all tables from database, 1 by 1, without error.
However, when I want to export all tables together, there is an error. I guess it is due to a concurrency issue (because the screen shows 2 tables are exporting together).
Can I change concurrency settings of the wizard? (set maxconcurrentexecutables to 1 in SQL Server). Or, do I need to use SSIS?
The error message is below:
Pre-execute (Error) Messages Error 0xc0202009: Data Flow Task 2: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error
code: 0x80040E37. (SQL Server Import and Export Wizard)
Error 0xc02020e8: Data Flow Task 2: Opening a rowset for "Table16" failed. Check that the object exists in the database. (SQL Server
Import and Export Wizard)
Error 0xc004701a: Data Flow Task 2: Destination 7 - Table16 failed the pre-execute phase and returned error code 0xC02020E8. (SQL Server
Import and Export Wizard)

mssql exporting stops in validating step

I am using microsoft sql server and i am trying to export my database but i get an error in the last step. Here is the full report:
Operation stopped...
- Initializing Data Flow Task (Success)
- Initializing Connections (Success)
- Setting SQL Command (Success)
- Setting Source Connection (Success)
- Setting Destination Connection (Success)
- Validating (Error)
Messages
Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "BookId".
(SQL Server Import and Export Wizard)
Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.
(SQL Server Import and Export Wizard)
Error 0xc004706b: Data Flow Task 1: "Destination - BookTable" failed validation and returned validation status "VS_ISBROKEN".
(SQL Server Import and Export Wizard)
Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
(SQL Server Import and Export Wizard)
Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
(SQL Server Import and Export Wizard)
- Prepare for Execute (Stopped)
- Pre-execute (Stopped)
- Executing (Success)
- Copying to [dbo].[BookTable] (Stopped)
- Copying to [dbo].[ChartTable] (Stopped)
- Copying to [dbo].[UserTable] (Stopped)
- Post-execute (Stopped)
It seems like there is an error in Validating step.
I am assuming that your Bookid is an AutoIncrement field and you are trying to populate data into that table from another source. You have to use Enable Identity Insert in your mapping to allow the Bookid to be updated.
Also, be sure that your seed is above the last value you inserted in the data exchange or you could run into errors down the road because you turned off safety checks when you overrode the Identity Insert behavior.

Importing data from worksheet into SQL Server

I am trying to import data from MS Excel (Pro Plus 2013) to SQL Server 2014. Every time I attempt to do so I get the errors below. The columns in the the table are set to nvarchar(50) while in Excel none of the columns have more than 30 characters. I have tried recreating the Excel spreadsheet over and over again, just to be sure I am doing everything right. I just can't get the data to import.
These are the errors I receive:
Validating (Error) Messages:
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_First_Name" with a length of 255 to database column "Agent_First_Name" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Last_Name" with a length of 255 to database column "Agent_Last_Name" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Email" with a length of 255 to database column "Agent_Email" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Extension" with a length of 255 to database column "Agent_Extension" with a length of 4.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Cell_Phone" with a length of 255 to database column "Agent_Cell_Phone" with a length of 10.(SQL Server Import and Export Wizard)
Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "Agent_ID".(SQL Server Import and Export Wizard)
Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.(SQL Server Import and Export Wizard)
Error 0xc004706b: Data Flow Task 1: "Destination - tableAgents" failed validation and returned validation status "VS_ISBROKEN".(SQL Server Import and Export Wizard)
Error 0xc004700c: Data Flow Task 1: One or more component failed validation.(SQL Server Import and Export Wizard)
Error 0xc0024107: Data Flow Task 1: There were errors during task validation.(SQL Server Import and Export Wizard)
It looks like you're trying to import into an existing table. I would recommend starting with importing the data into a new table (for example, "tmpAgent" -- and you can delete this table later). Allow SQL Server to pick the tables size of the import, or you can set the size in the "Edit mappings" section of the import.
After you have imported the data into a new table, then create a query to move it into your Agent table.
I encountered the same error message.
Turns out I had a rogue cluster of merged cells in the excel file. I un-merged those cells, re-tried the import, and all my data were successfully imported to the excel file.

Failed importing file in SQL Server Managment studio

In SQL Server Management Studio I exported a table from one database to an .xslx file, then imported it to another database on a different server. It failed to import and gave the following details:
Validating (Error)
Messages
• Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "QuestionID".
(SQL Server Import and Export Wizard)
• Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.
(SQL Server Import and Export Wizard)
• Error 0xc004706b: Data Flow Task 1: "component "Destination - HJFast_Track" (47)" failed validation and returned validation status "VS_ISBROKEN".
(SQL Server Import and Export Wizard)
• Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
(SQL Server Import and Export Wizard)
Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
(SQL Server Import and Export Wizard)
My best guess is that QuestionID is an auto-incrementing identity field. In order to insert values into that column you'll need to specify.
SET IDENTITY_INSERT YourTable ON
Your other option if that field is an auto-increment identity is leave it out of the import/export and let the sql engine generate keys like it would for any other insert.
Without having the schema of your table in front of me a guess is as good as I can offer.
If you update your question with the structure of the table your trying to insert that might give other clues. For example, if QuestionID is a guid or something.

Resources