SQL Trouble Importing Data from .csv file - sql

I am importing data in my database using SQL server, through excel .csv files. I right-click on the database I'm using, tasks, import data, go through the steps of selecting the file, choosing the destination:
data source
going through the whole process, it says that all of my data has been imported successfully but when I check the table, there is no data.
Has anyone ever come across this? Or know of a reason as to why the data is not showing up in the table I have selected it to?
Thanks!

Related

how can I get the data out of an .fb file?

I'm working with a company trying to setup a new database system as their old database software has gone out of business. All the data is in a .fb file that is encrypted (You used to have to get backups 'unlocked' before they would let you use them).
I've managed to get a copy of the database (I think it's unencrypted as I copied it while the database was open and then changed the copied files permissions using terminal).
The problem is that it's a .fb file and I can't find a way to 'open' it to browse the data...
Any Ideas?
Generally speaking, data stored in relational databases aren't just stored as ascii csv files. So you won't be able to just open up a .fb file in a text editor and grab the data.
If you're still able to query the database, you will need to have the frontbase server generate a dump of the data into a flat file.
See the frontbase documentation for backup and restore. Specifically 4.9.1. Exporting Schema and Content Data:
WRITE ALL OUTPUT('<output-directory>' [,'YES']);

.SQL export from PHPMyAdmin to Excel or CSV

I inherited some old records for a company I volunteer for. One of the old files is an SQL Dump from their old webpage, and I would like to get the data from one of the tables for their use into Excel.
-- MySQL dump 10.11
The dump drops the table if it exists, creates the table new, and then inserts all of the data.
Is there some easy way I can get this data into Excel on my PC? I don't have SQL Server or anything like that loaded... I assumed there was some easy way to get a CSV or Excel file out of it but I have failed to find this yet without first uploading the dump to some SQL Server.
Unfortunately I don't think that there is any way to export a dump file into an excel or .CSV file. The reason for this is that the dump file is actually a collection of Select statements instead of the actual data itself. SQL servers do this to prevent a whole list of problems that can occur when you try to manipulate raw data manually.
Lucky for you, MySQL offers a free version of their server. You can find it here: http://dev.mysql.com/downloads/
I think you are best off downloading this and restoring your file as a new database. This has the added benefit of allowing you complete control over the data from that point on. Exporting to excel would be easy at that point however, you may find it a lot more fulfilling to continue using MySQL server.
Hope this helped.

Import updating CSV into SQL Server

I'm looking for a simple solution (beginner to SQL) to allow the import of data from my .csv file to my SQL DB.
I have a third party program that is updating my .csv file every 30 seconds and I want to put that updating information into my SQL DB. I tried the importing & exporting wizard but it didn't work due to the .csv file being utilized by the other third party program.
Getting the information into the SQL DB doesn't need to be in real time it could just retrieve all the information when opening a saved sql query file.
Thank you!
OPENROWSET is the simplest one if you get that working in your env for CSV file. i have seen lot of issues with what OS, and what version of MS office installed with 32bit or 64 bit.
but bit more work and you will be all set with creating a small SSIS package to import that CSV in to table. execute that SSIS using SQL JOB at desired interval. later if you needed more complex insert/update you can always modify the package.
This is the case of producer consumer problem where one process is writing data and another one is reading it.
Whatever you do you need to setup some kind of lock on this file that process can check if file is available for reading/writing. If import/export wizard had issues with concurrency then probably other processes will also.
Another option is to always create new file to write into and have reader process to always read from the newest one and delete it after processing.
One more thing you’ll have to take care of is reading from same file multiple times. You need some way to mark the records that have already been read so these are not inserted twice.
All of the above is needed if this needs to be a fully automated and unattended process.
If not you can just manually create a copy of CSV file and then use import/export wizard to import the data.
Here is another resource you can check out for importing CSV into SQL Server
http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/

Bulk data insert in MS Access

I have an .mdb file, which is used as a data storage by one particular application. The application itself does not have tools to insert large amounts of data, and I need to insert around 300-400 generated records.
How can this be accomplished without using VB? (since I know nothing about it)
At first I thought that writing a procedure, but from what I can tell Access does not support procedures and functions (which ir really weird), only basic SQL statements.
Is exporting data into other DB like Postgre, writing and running a procedure there, and importing the data back into .mdb file possible? Or there are other solutions?
If you're looking to export data from a specific table then select that table and right click on it. A menu will appear that allows you to export the contents of that specific table. Choose the format (probably .csv or .txt for max flexibility) and then import it whereever and manipulate it accordingly.
If you want to reimport your results then choose from the File -> Get External Data -> Import menu and import your newly manipulated data. That should do it. Just make sure that the data columns align properly with the table your importing into. This shouldn't require any VBA. This advice is pertinent to Access 2003.

Using temporary tables to store data from Excel file

I've got a database with information on servers and applications. I also have an Excel file which has some of that information saved in it .
What I'm trying to do is compare the database with the Excel file and output all the results which are present in the DB and not the Excel file, and vice versa.
After some thinking, I decided that it might be best to create temporary tables and save all the data from the Excel file into them, and then do an outer join between the corresponding tables (I'm using SQL Server).
How do I go about doing this without creating models in Rails for them (unless I specifically have to create them)?
Not sure how to use raw SQL in this instance =s
You actually have several choices on how to import the Excel data. If you're looking for a strictly SQL Server solution then you can use a linked server or distributed queries. You can also use DTS/SSIS (depending on your version of SQL Server) for a solution that's external. You could call the SSIS or DTS packages from your own code. Excel also has an OLE DB provider, so if your application uses ADO or otherwise uses OLE DB then you can use that.
All of these methods are explained in a little more detail on Microsoft's website, including some sample code for some of them.