How can I import a csv file into the google cloud sql service (opposed to importing a sql dump) - sql

How can I import csv files into the google cloud sql service (opposed to importing a sql dump)?
Can I in some way use the squirrel client?
Thanks

I just started using Google Cloud SQL. I connected to my instance with the MySQL Workbench. I created my first table, but then I wanted to import a CSV file into that table, and it was not clear on how to do that from MySQL Workbench. So, here are the steps to do this (thanks Aimon Bustardo):
Convert your CSV file to a SQL file using this site (there are other options to convert to SQL, but this is an easy service): http://csv2sql.com/
From MySQL Workbench Navigator for the MySQL instance, click "Data Import/Restore"
Click "Import from Self-Contained File" and then select the SQL file created in Step 1.
Click "Start Import" and your data is uploaded to the Cloud!

Converting it to SQL is your best be until they have a csv importer. There are command line utilities or online services. One of which that is free: http://csv2sql.com/

Related

Migrate from Azure SQL back to Access

I have a SQL database in Azure. Is there any way of downloading the SQL database in .mdb format?
Is there any way of downloading the SQL database in .mdb format?
Not directly in .mdb format but what you can do is export the database in BACPAC format and save this file in Blob Storage. Once the file is there, you can download this file. You can find more information about this here: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-export. If you're doing this from Azure Portal, please read this: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-export-portal
Next step would be to create a local database using this BACPAC file. Please see this link on instructions on how to import a BACPAC File to create a new user database: https://msdn.microsoft.com/en-IN/library/hh710052.aspx.
Last step would be to export this database and import it in Access. You can make use of SQL Server Import/Export Wizard to do so. Please see this link for more details: https://technet.microsoft.com/en-us/library/ms141209.aspx.

importing CSV from SAP R/3 to SQL database for reporting purpose

I want to import CSV files and invoices from SAP R/3 system into a SQL database. The database will be used for reporting purpose only, please tell me what will be the best possible way, which database to use and anything else that will be relevant to me in this context? and I am novice so please help....Thanks:)
If you are routinely importing CSV files then I recommend getting them comma delimited (or whatever delimiter you choose) and going the route of making an SSIS package with a corresponding SQL Agent Job that runs daily to check for the file and run it if it finds it.
Info on SSIS package creation:
http://smallbusiness.chron.com/import-csv-ssis-46849.html
If this is a one time load then I would recommend just using the import export wizard built into SQL Server.
https://msdn.microsoft.com/en-us/library/ms140052.aspx
Pretty easy to use the import export wizard too. Right click the database > tasks > import data. This will launch the wizard and will walk you through the one time import.
Adding Microsoft's official SSIS guide as well:
https://msdn.microsoft.com/en-us/library/ms169917.aspx

Automating an upload of data to rdbms from a google spreadsheet

I have a google doc that I'm using to update a table in a sql table and at the moment I do it manually; copy and paste the data from the google doc. into excel, remove the columns that I don't need then save as a CSV and upload.
I'm wondering if there is a way that I can automate this? The report it's for is daily and the upload is becoming a bit of a bore!
You can also go the python-route by utilising the following python libraries: gspread, oauth2client, pandas and sqlalchemy (source). If you want to automate it, use cron or crontab to run your python-script on a hourly, daily, weekly or monthly basis.
What DBMS do you use?
If you use Microsoft SQL Server, you can use SSIS (SQL Server Integration Services), the easiest way to do this for a novice would be to right-click on the database in SQL Server Management Studio --> Tasks --> Import Data, then follow the wizard to set up the data source (flat file / Excel file etc.) and the data destination (DB table). Once you've finished with the wizard, you can save the package and re-use it later on (or even automate it via SQL Agent job). You can edit the package in Visual Studio (aka SQL Server Data Tools) prior to deployment/automation if needed.
More on SSIS: https://msdn.microsoft.com/en-us/library/ms169917.aspx

Export database from SQL Server Management Studio

I've managed to 'Restore' my database using the SQL Server Management Studio.
I now need to export that so I can import it into my websites empty database.
I've tried Tasks/Generate Scripts but I can't import the file it generates into my database on my site.
I get the following error message:
Could not find stored procedure 'xxx'
I've also tried to Export Data but I don't appear to get a result at the end of the process. Possibly because I'm using the free version of the software?
Are there any other ways to export this data into a .sql file so I can import it?
I'm just moving a site from one server to another - it shouldn't be this difficult!
Any help would be really appreciated!
Try the Microsoft SQL Server Database Publishing Wizard. Available at:
http://www.microsoft.com/en-us/download/details.aspx?id=5498
Use the generated .SQL file with these steps:
http://www.123-reg.co.uk/support/answers/Databases/Windows-MSSQL/how-do-i-import-export-a-mssql-database-793/
I don't know if you've managed to resolve this but I have found that the SQL file saved from SSMS is in Unicode format and the 123-Reg website is expecting plain text. This is what's causing the "Could not find stored procedure..." error message.
Instead of saving the file, copy and paste the text from SSMS into Notepad, then save that. The file should then upload correctly into the remote database.

Import .sql file in Access

I need to import to Access a .sql database backup file created with MySql .
Is there a way to perform this operation?
You can't restore a MySQL backup into any other database system.
If you want to import the MySQL data into Access, you could export it all into CSV files and import those to Access. You will still need to recreate relationships, defaults, indexes (?) and other data.
You can import SQL Server data into a new Access table. In general, importing is a way to convert data from a different format and copy it into Access. The source table or file is not altered in this process. You can import directly from a SQL Server database using an ODBC connection, a text file exported from SQL Server, or an XML file exported from SQL Server.
To make frequent import operations more convenient, you can automate them by creating a macro or creating a Microsoft Visual Basic for Applications (VBA) procedure. This is useful, for example, when you import data on a regular schedule or you have unusual or complex requirements for importing data.
if you use SQL Server Management studio then you can open the .SQL files and it will give you help in figuring out what syntax works in SQL -- and which doesn't.
For example, if you have a table name that is mis-spelled, SQL Server Management Studio will give you red squigglies under that table name.
I don't see that functionality in Access, and I don't think that it's coming any time soon. Access (Jet) hasn't gotten any new features in almost fifteen years.