Migration from postgresql to Mysql - mysql

Hello there i'm really newbie to SQL and i have a problem to create a dump file properly, I have an assignment and i don't really have no idea what's wrong, can anyone help me to migrate it? According to phpmyadmin the error is somewhere in this part.
CREATE TABLE DEPT (
DEPTNO NUMERIC(2) NOT NULL,
DNAME CHAR(14),
LOC CHAR(13),
CONSTRAINT DEPT_PRIMARY_KEY PRIMARY KEY (DEPTNO));

Why not use an ETL Tool? you dont have to worry about dumps or stuff like that. You just need to know the connection credentials and thats it. I personally use Pentaho ( it's open source ).
Download Pentaho ETL from http://kettle.pentaho.org/
Unzip and run Pentaho (using .bat file spoon.bat)
Create a new Job:
Create DB connection for source data base (PostgreSQL) - using menu: Tools→Wizard→Create DataBase Connection (F3)
Create DB connection for destination data base (Mysql) - using technique described above.
Run the Wizard: Tools → Wizard → Copy Tables (Ctrl-F10).
Select source (left dialog panel), and destination (left dialog panel). Click Finish.
The Job will be generated - Run the job.
Thats it! If you need any help let me know.

I've tried to open the tools via pgadmin3 but is something like frozen, I reboot my pc and still have no access to the "tools"

Related

I cant see my mysql database button in excel

I cant see "From mysql databases" button in Get data tab in excel, and just can see Microsoft databases such as Sql-server, Access, SSAS ...and unfortunately Im not be allowed to post the image here,
does anybody know the solution?
After downloading the MySQL Driver from this link as described in this post I can add a new ODBC data source and am able to select the driver.
Data -> From Other Sources (last one in drop down) -> From Microsoft Query
There select New Data Source and press Ok. In the form you can define a new data source, select the mysql driver etc.

Restore unsaved MySQL Workbench scripts?

I had a bunch of unsaved scripts open. Today I restarted MySQL Workbench, there was an error message and now the scripts are gone. Is there a way to restore them somehow?
You can try to find your script in History Output. Check this answer: MySql workbench query history ( last executed query / queries ) i.e. create / alter table, select, insert update queries
If the save snapshot option is enable (this can be done by --> Edit>Preferences>SQL Editor>Save snapshot of open editors on close) then you can find the data in \%APPDATA%\MySQL\Workbench\log\sql_actions_unconnected.log. It is a log file, you can copy your code and paste it in a code editor which would put the code in the right format
This just happened to me and thankfully it turns out MySQL Workbench does actually autosave tab contents to disk. You can find them starting at your base configuration file path which is described here. The path to the scratch files is something like this:
{BASE_CONFIG_PATH}/sql_workspaces/{CONNECTION_NAME}.autosave/
Inside that folder is a bunch of .scratch files, looks like one per tab you had open for that connection. They're named with UUIDs, but just drop them all in a text editor and you should be able to find your lost tab contents pretty quickly.
If they're gone, they're gone, unfortunately. You should save them before you exit WorkBench (CTRL+S), since it has been very prone to errors like that, at least to me.

Set up a Datasource for Tabular Models in SQL Server

I want to go through this tutorial. Unfortunately the author has already set up the datasources
and does not explain how to set them up. First off I installed an separate SSAS Instance in my sql server 2014. Then I tried to add a .mdf file via "Attach" but get the Error "AdventureWorks.detach_log could not be found in the folder". So according to this SO solution I tried this command:
CREATE DATABASE YAFnet ON (FILENAME = N'C:\sql_data\YAFnet.mdf')
FOR ATTACH_REBUILD_LOG;
within my SSAS instance query editor but it looks like the query is not a proper one since it is mdx.
Anyone who can help me to get a datasource (adventureworks dw) for my tabular model so I can follow the tutorial?
I would download the tabular backup from AW samples and recover the .abf file

create a new job with different name from backup of existing SSIS job and multiple database name in ssis config file

I would like to create new job by copy from existing job and point the new job to another database. I tried to find out the the steps and did not find any suitable steps for this.
One thing I know is: this can be done using "script job as" -> "create to". and then changing the name of the job.
However, is there any other step needs to be taken care? How can I points to a different DB? Can I make my connection string in config by adding two data source[like we can add multiple email with comma separated]?
something like this:
<InitialCatalog>Systest1,Systest2</InitialCatalog>
Do I need to change the SSIS config file?
Please give me some tutorial for this or few steps that may help. Thanks.
You will need to parametrize your connection manager in the package you are running and pass the connection string from the agent job. Then you can have two jobs that run the same package on different databases.
To parametrize the connection manager, right-click on it and select "Parametrize" from the pop-up menu.

modifying SP in sql server 2008 by using SQL query

We are promoting a lot of old stored procedures to production but the are referencing a development box. Is there any easy way to search all the procedures and update them? I tried updateing the defintion field in the sys.sql_modules, and also tried updating the syscomments.text but was unable to. Here is an example of what I am trying to do.
in a stored proc we have the following select * from vmdproduction.test.dbo.table1, I would like to rename the vmdproduction to production in all cases across all stored procedures.
Thanks
This is how I would do it... In Management Studio, right-click your database, select Tasks, Generate Scripts. Go through the wizard and be sure to include all stored procedures and to "Script DROP and CREATE" (under advanced options). This will generate a script file which will drop and recreate all the procedures. You can then do a find and replace before you run the script. Be sure to backup the db before running it though!
Using SQL Server Management Studio
To modify a procedure in Management Studio
1.In Object Explorer, connect to an instance of Database Engine and then expand that instance.
2.Expand 'Databases', expand the database in which the procedure belongs, and then expand 'Programmability'.
3.Expand 'Stored Procedures', right-click the procedure to modify, and then click 'Modify'.
4.Modify the text of the stored procedure.
5.To test the syntax, on the 'Query' menu, click 'Parse'.
6.To save the modifications to the procedure definition, on the 'Query' menu, click 'Execute'.
7.To save the updated procedure definition as a Transact-SQL script, on the 'File' menu, click 'Save As'. Accept the file name or replace it with a new name, and then click 'Save'.