SSMS can't open data file - sql-server

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?

Related

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)

Import Large Cities Text File into SQL server

I'm trying to import Text file for cities name into SQL server 2012. The file is 1.45 GB, I'm using SQL Server Import and Export Wizard to do the job but each time I get this error:
Copying to [dbo].[worldcitiespop] (Error)
Messages
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "City" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
(SQL Server Import and Export Wizard)
Error 0xc020902a: Data Flow Task 1: The "Source - worldcitiespop_txt.Outputs[Flat File Source Output].Columns[City]" failed because truncation occurred, and the truncation row disposition on "Source - worldcitiespop_txt.Outputs[Flat File Source Output].Columns[City]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
(SQL Server Import and Export Wizard)
Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "C:\Users\elsho\Downloads\worldcitiespop.txt\worldcitiespop.txt" on data row 114091.
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Source - worldcitiespop_txt returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
I changed the Table fields size to the text type to avoid data length problem but this did not help,please advise.
Thanks
I strongly recommend that you use a staging table. Import the table into a staging table with wide nvarchar() text fields.
If you cannot do this successfully, then the data file itself is probably corrupted.
After you have loaded into the staging table, insert the data (with appropriate conversions) into the final form (and then build indexes). It is much easier to find such problems when the data is already in a table than when trying to import it frustratingly over and over again.

SQL Server import data

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?

How do I copy all tables in database to Excel

I have a SQL Server 2008 database and I wanted to quickly copy all the data in the database into either separate Excel spreadsheets or into a single spreadsheet in separate tabs. Putting the data into separate CSV files is also ok. How do I do this without having to do a select * from for each of the tables and then copying the data into Excel? There are a lot of tables.
EDIT
Running the wizard to export data I get this error on Pre-execute
Pre-execute (Error)
Messages
Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.
(SQL Server Import and Export Wizard)
Error 0xc0202025: Data Flow Task 1: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
(SQL Server Import and Export Wizard)
Error 0xc004701a: Data Flow Task 1: component "Destination - ApprovalStatuses" (25) failed the pre-execute phase and returned error code 0xC0202025.
(SQL Server Import and Export Wizard)
Thanks,
Sachin
Using Server Management Studio:
Server Management Studio (right click on db) >
Tasks >
Export >
Login >
Destination box select Microsoft Excel > ...
If you are on a 64-bit server then;
Windows > Start Button >
All Programs >
MS Sql Server [your version] >
USE Import and Export Data (32-bit)
See this link http://www.66pacific.com/sql_server_export_to_excel.aspx
Using the SQL Server Import and Export Wizard, you can easily copy tables from the database to the spreadsheet.
You can directrly export table from database to excel file using sql-server Import and Export Wizard.
Have look at this article about Exporting SQL Server Data to Excel.
Ok, see this link http://www.hotscripts.com/forums/windows-net-programming/59962-export-data-database-excel-via-sql-command-customize-style-vb-net-without-auto.html for a quick way of doing it.
Ideally, if you get time to program it, I would use RDLC to build custom reports which you can export out as Excel using DataTables.
See my blog post at https://mashupweb.wordpress.com/2012/02/08/creating-an-online-list-of-users-in-a-database-using-report-wizard/ on how export data onto Excel using RDLC.

Import flat file into SQL Server 2005 with Import/Export wizard gives product level error

I am using SQL Server Management Studio Enterprise 2005.
I am trying to import a text file with pipe delimited data into my SQLserver table.
However when the process of importing, the system gave me this error log:
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 0xc00470fe: Data Flow Task: The product level is insufficient for component "Source - userrolelist_TXT" (1).
(SQL Server Import and Export Wizard)
Error 0xc00470fe: Data Flow Task: The product level is insufficient for component "Data Conversion 1" (95).
(SQL Server Import and Export Wizard)
Prepare for Execute (Stopped)
Pre-execute (Stopped)
Executing (Success)
Copying to [SOD].[dbo].[userrolelist] (Stopped)
Post-execute (Stopped)
Cleanup (Stopped)
I have read that I would need to install SP2 because this is a bug. Anyone know how can I solve this and are there any other alternative I can use to import a pipe delimited data file into my tables?
Services required for SSIS on your SQL Server installation might not have been installed such as ervice, dtexec, and dtexecui.
http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/289d0bbb-1d06-4856-9c66-8d3e540d7be9/
are there any other alternative I can use to import a pipe delimited
data file into my tables?
I believe Kip has hit the nail on the head with the Integration Services Service not being installed.
If this is a straight import of data, it's hard to beat bcp or BULK INSERT.

Resources