The tag has no wiki summary.

learn more… | top users | synonyms

11
votes
1answer
4k views

Can I query a tab-delimited file from SSMS?

Is it possible to query a tab-delimited file from Sql Server Management Studio to view its data without saving it anywhere? I know you can BULK INSERT from a tab-delimited file using something like: ...
9
votes
5answers
11k views

Save Results as CSV *with* headers in SSMS

With SQL Server 2008 R2, when I save the results as a CSV there are no headers. I can work around this by copying and pasting with the "Copy with Headers" , or just grab the headers and paste them in ...
6
votes
1answer
284 views

How many disk seeks does it take to write one row on SQLite?

As far as I understand, there can be one disk-seek per rotation of a harddisk, therefore I am interested to know how many disk seeks are needed for writing a row to an SQLite table, including locking ...
4
votes
1answer
3k views

Update oracle sql database from CSV

I tried google at first but no luck. Is it possible to update tables from csv file? I am using SQL developer and I am using a script to export edited rows to a csv file. I would like to update the ...
4
votes
1answer
753 views

MySQL Import CSV with Multiple Field Separators

I'm trying to import this CSV file into MySQL that appears to be optionally enclosed by more than one character. Unfortunately, MySQL only supports one character as a field separator. I am stuck ...
3
votes
2answers
7k views

psql denies access to file when using COPY FROM

When I do this: COPY "mytable" FROM '/my/file.csv' WITH DELIMITER AS ',' CSV; On this: -rw-r--r-- 1 peter peter 54819176 2011-07-21 13:17 file.csv psql tells me this: ERROR: could not open ...
3
votes
0answers
332 views

Conversion of GRIB and NetCDF to my database [closed]

I have downloaded "High Resolution Initial Conditions" climate forecast data for one day. The file had an .tar.gz extension so I extracted it in my local directory and I get the files listed here: ...
2
votes
4answers
153 views

Options for dumping Oracle queries to text files with no database server filesystem access

I've an application currently producing reports using UTL_FILE and DIRECTORY. We are migrating this application to an environment in which there will be no filesystem access on the database server ...
2
votes
1answer
15k views

How to import a.csv file into a postgresql database using \copy?

I am trying to import a .csv file into a postgresql database. I am using pgadmin III for that on a win7 machine. My query looks like that: \COPY pop_grid(GRID_ID, POP_TOT, YEAR, METHD_CL, CNTR_CODE, ...
2
votes
2answers
8k views

MySQL - CSV UPDATE (not INSERT) into existing table?

I have a table with the following columns: id | name | city The table has 1000 entries in it. I have a CSV file with a limited number of lines like this: id,city 34,Denver 45,Kansas City 145,New ...
2
votes
3answers
431 views

What's the easiest way to re-format CSV exports from MySQL into Excel/ flat-file fields?

I've just had some database backup problems on a website I run containing some important lead data. Unfortunately, I've now lost one of the key MySQL tables, which means my data has lost its ...
2
votes
1answer
288 views

Apply in a CSV file to multiple databases

Recently, I have been working with a client whom has asked us to provide their dataset for use in a mobile application we are making for them. The requirements for this project include the ability to ...
2
votes
1answer
718 views

excel sheet input to mysql

I want to add about 1000 records to a table that contains 31 fields. The worst part is those 1000 records are in the form of an excel sheet having some columns left unfilled. Is there any easy way to ...
2
votes
0answers
440 views

Can PostgreSQL's COPY create CSV with Locale-specific number formatting?

I want to create a CSV with PostgreSQL 9.1 COPY that directly opens correctly with a double-click in crazy German Excel 2010. Using ";"-Delimiter is easy. The encoding is solved, but Excel only ...
2
votes
0answers
108 views

sql data to a csv-file via cobol

I 'm using the following code : string 'insert into ' delimited by size 'tgamGameTeams ' delimited by size '(Id,Name,RemainingBudget,TeamGamePoints,GameId) ' ...
1
vote
5answers
265 views

Export data from a CCURE 800/8000 System using a pair of ODBC data sources?

I'm working on a security system called CCURE 800/8000 and trying to export some entrance / exit data from the Activity Monitor that logs when people use their badges to enter and exit the building. ...
1
vote
2answers
111 views

How can I get PostgreSQL to not advance sequences when COPY fails?

I'm importing CSV files into a relatively simple PostgreSQL database. (The CSVs are sometimes created manually from information in a book, sometimes created from spreadsheets with a little massaging ...
1
vote
1answer
168 views

Looking for an efficient way to clone tens of millions of database records

A laboratory I work in is attempting to clone the open, biochemical database managed by PubChem found here. (Please don't ask why, I am not in charge of this project, I am simply tasked with the ...
1
vote
1answer
415 views

How to troubleshoot COPY FROM inserting less rows then expected?

I have a CSV (tab-delimited in fact) file with 7,590,051 lines, according to wc -l, which I want to import using COPY FROM. I removed the table's primary key, so it has no constraints. I ran COPY ...
1
vote
1answer
519 views

Behavior of PostgreSQL COPY FROM

Let me preface this question by stating that my experience with DBA is limited to an introductory undergraduate university course, and that I'm just getting started with PostgreSQL. I would like to ...
1
vote
1answer
136 views

unable to import the file

Gone through the below link also but i am unable to import CSV file in mysql. Even i had tried by using > LOAD DATA LOCAL INFILE but same error persisting. Please help me in this. queries i tried had ...
1
vote
1answer
8k views

MySQL import csv file ERROR 13 (HY000): Can't get stat of /path/file.csv (Errcode: 2)

I am an absolute beginner to MySQL (5.5.34) / Linux (Ubuntu 12.04 LTS)` I have created a simple database with one table. When trying to import data into it via a 'data_test.csv file an error message ...
1
vote
1answer
74 views

When importing raw files for internal conversion, should I use a secondary database or just isolate them within the database?

When importing raw files for internal conversion, should I use a secondary database or just isolate them within the database? I've got between 1.25 and 2GB of CSV files to be imported (and already ...
1
vote
1answer
903 views

Dealing with empty strings while loading a table from a CSV

I am trying to load a CSV file into a table. The CSV file contains some empty strings for example: 1,2,,4 I want to load the empty field as null. One way I know is to use \N i.e: 1,2,\N,4 but it ...
1
vote
2answers
1k views

Loading data in mysql using LOAD DATA INFILE, replication safe?

I am trying to load data into mysql database form CSV file. I found that we could use LOAD DATA INFILE command to do it. But as per the mysql documentation it is not replication safe. (See here) Is ...
1
vote
1answer
119 views

Can I create a MySQL CSV table directly from an existing CSV file?

MySQL has a CSV storage engine. I'm wondering if I could create such a table directly from an existing CSV file. Made up command as example: CREATE TABLE test (i INT NOT NULL, c CHAR(10) NOT NULL) ...
1
vote
2answers
240 views

Advanced CSV export formatting in MS Access

I am trying to create a CSV file with the following format (for import into MYOB AccountRight financial software): InvoiceNum1,Line1,... InvoiceNum1,Line2,... InvoiceNum2,Line1,... ...
1
vote
1answer
468 views

import csv data stored in a blob column

Here's what i need to do: Users will upload CSV files into SQL Server 2012 blob column Each night, i would like to take each file and import the data into table I will have 2 web sites using the ...
1
vote
1answer
677 views

Command line export and import CSV in SQL Server 2008 R2

I have a database xyz and 100+ tables and has to perform the following operations on the command line: I need to create CSV of all tables in one go. CSV with column separator ,, fields enclosed by " ...
1
vote
1answer
958 views

MySQL import csv only gets half the lines

I use the following command to read in a csv: LOAD DATA INFILE '/Users/Tyler/Desktop/players_escaped.txt' INTO TABLE players FIELDS TERMINATED BY ',' ENCLOSED BY '^' LINES TERMINATED BY '\n'; The ...
1
vote
2answers
849 views

Access exporting to CSV is weirdly slow

I have searched but could not find anything similar. If I just run the query, I can get the result pretty quickly (~5 mins); but after I saved the query to export as CSV, the exporting part is ...
1
vote
0answers
19 views

Any way to mitigate the large server load during LOAD DATA LOCAL INFILE operations?

I'm using MySQL LOAD DATA LOCAL INFILE to load csv files, and have noticed that during these loads, server output speed to other users diminishes eg long page download times, logins timeout. The LOAD ...
1
vote
0answers
61 views

Join and aggregate result and insert blanks for missing appendants

Consider these two simplified tables: CREATE TABLE "sources" ( "id" serial NOT NULL, "name" text NOT NULL, CONSTRAINT "sources_pkey" PRIMARY KEY ("id") ); CREATE TABLE "values" ( ...
1
vote
0answers
956 views

sqlldr error - Invalid number

I am trying to load the following csv file into a table: TIMESTAMP ; SESSIONID;PROXY_SESSIONID; ACTION;USERNAME ;USERHOST ;OS_USERNAME ;CLIENT_ID ...
1
vote
0answers
75 views

Best way to store data with small differences for collective analysis

I have a collection of CSV files each containing data about the same topic, but with small differences. For example units carrying out a job might in one file be identified by one field, in the other ...
1
vote
2answers
340 views

Import CSV file into Mysql with Multiple Delimiters/Field Separators

I'm trying to import a large csv file into Mysql. Unfortunately, the data within the file is separated both by spaces and tabs. As a result, whenever I load the data into my table, I end up with ...
1
vote
0answers
39 views

Import CSV file into SQLServer [duplicate]

Possible Duplicate: Convert varchar column to datetime Hi I am using the SQL server Import wizard to import a CSV file into what will be a new table in my database. An example of the CSV ...
0
votes
2answers
2k views

Doing a comparison on two csv files with no Primary Key

I'm wondering if in SSIS there is a way to compare two csv files(with the same structure) with no reference key to make a record unique. To give you a better picture from what I mean; In initial load ...
0
votes
3answers
5k views

Export Postgres table on remote server to CSV file on local machine?

I have access to DB on remote server where I can do only select command, So, I can execute: COPY products TO '/tmp/products.csv' DELIMITER ','; But on that server I don't have permission to ...
0
votes
1answer
239 views

Import errors importing CSV to SQL Server table

I am using SQL Server 2014 Management Studio to import a very large .CSV file into a table. So far I have been trying to accomplish this by right-clicking on the database and selecting Import Data, ...
0
votes
1answer
19 views

Import CSV file - dynamic path

I am trying to import a csv file dynamically. This works: BULK INSERT #CSV FROM 'C:\Users\MyName\Desktop\Players.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) I would like to ...
0
votes
1answer
50 views

SQLCMD - add date to CSV. When run inside Command Prompt it works, when in Job then %date

I've been battling for hours to add a date to a CSV name: For brevity, Im just taking the first character of the date here. In SQL Command, this works: sqlcmd -S localhost -d master -E -W -w 999 -s ...
0
votes
1answer
57 views

Select IDs according to CSV file

I have a CSV file with IDs of rows. I want to use that to make a SELECT statement selecting the IDs within that CSV file. There is 1 million rows and I want to select about 95,000 of those. I want ...
0
votes
1answer
118 views

Load csv into MySQL database programmatically

I know about LOAD DATA INFILE command -- however, this requires that we already have the table with appropriate columns in place. When I have csv with hundreds of columns, it is not feasible to type ...
0
votes
1answer
474 views

Bulk loading to partitioned table

I am designing a database application which will be using PostgreSQL 9.3. My question is regarding bulk loading a CSV to a partitioned table. I have done a lot of research, but I'm still unsure of ...
0
votes
1answer
660 views

Getting error while importing large data through csv

I am new Postgres. I am getting constraint violation errors while importing a large CSV file. I want to disable all of the database constraints temporarily - I do not know how to do this.
0
votes
1answer
374 views

Permission Denied Copy [closed]

I am a beginner learning how to load data and I can't figure out why I can't load this data into postgres. I am using postgres 8.4 on MAC OS. copy tname from '/Users/Shared/folder/file.cxv' ...
0
votes
1answer
333 views

Which tools can be used to clean CSV files prior to bulk insert?

Which tools and programming libraries are you aware of that can help accelerate CSV manual correction process when column separator characters are encountered within data elements? I'm currently not ...
0
votes
0answers
16 views

Improve processing of data and structure design from flat file to CMS DB (using intermediate DB)

I have a flat file (CSV) that brings me the data I want, but it needs to be cleaned and processed before it can be used, so I built an intermediate Database (MySQL) in order to get the structure from ...
0
votes
1answer
22 views

Import csv data from localhost emacs SQLi error MySQL

I'm trying to import LOAD DATA LOCAL INFILE "/home/frederic/cowtest.csv" INTO TABLE cow_db1 FIELDS TERMINATED BY "," ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (state_abb, ...