Wednesday, May 11, 2016

How to migrate data from My SQL database to SQL Server Using SQL Server Data Import and Export Wizard

Hi guys,

 Yeah. Its been a while since I posted last. So what I wanted to tell you guys today is how to migrate data from My SQL database to a SQL Server. Well when you google it you may fine various ways to do that. Most of them require 3rd party software like ODBC Data Source Administrator or SSMA (SQL Server Migration Assistant). Well if you were someone like me then of course you will export the database from My SQL Server to a .sql file and then try to insert data manually. So this post is for the guys who have tried it all and nothing worked out.
    What I will be using in this post is SQL Server Import and Export Wizard. First question that comes to any one's mind is where can I find this? Is this another 3rd party software that I have to download and install in my PC. Well this is a inbuilt function in SQL Server. For this post I will be using SQL Server 2014 for the demo. Let get to it then.

This is how its done. First you need to install SQL Server 2014 and you need to have a remote or a local My SQL data base which you are targeting to migrate data from. After installing SQL Server you have to create a database so that you can migrate data from My SQL database.




When you open the SQL Server you will get a window like this. Guys don't be concerned about the query in this pic. I took this photo from google. On to your left side you have the Object Explorer window opened. In that window we have the following main folders.

 In these folders simply right click on the database folder and you will have a menu. There click on the new database option then you will get a window like this.


 Give a name to the database and press OK. There you go, now you have a brand new database. For this post the I have created a database named test. Once you have your database ready go into the database folder and you will see your database. Right click on it and you will get a menu. In that menu at the bottom you will have a bar named Tasks. When you place your mouse cursor on that tab you will get another menu. At the bottom of this menu you will see 2 options. They are

  1.  Import Data
  2. Export Data
Since we are migrating data from My SQL database you need to click on the Import data option. Now  you will get the opening window of SQL Server Import and Export Wizard.



 If you don't want this this introduction window to appear every time you open this, you can check the check box near the buttons at the footer of the window. If you like this window just like I do the simply press the next button. Then you will have a window like this.

In the data source tab select .Net Framework Data Provider for MySQL from the drop down list. Then you need to add some information which will allow this application to access your My SQL database. Now scroll down to Connection and give the following details.


In here you need to give the information about your My SQL database. You need to give the database name, port number and the server. Finding the port is really easy.just type "Show Global Variables Like 'port' ". If you are using your local server like WAMP Server of XAMMP  Server you can give local host just like I have done. If not you need to give the specific server name.
   Then you need to give the authentication credentials to access the My SQL database. To do so you need to scroll to the bottom of the window where you will find Security section.

Your default user name is root and I have kept that here. Even though I have used the default one, if you have a different user name, make sure to use that user name as User Id. I would always recommend having a password for your database. So I have entered the password as well. Then click Next. If every thing goes well then you will have an window just like the previous one but with out data. The first window was for our source and the second one is for our destination. Since we need to import the data to SQL Server we need to select SQL Server Native Client form the drop down menu where we selected the .Net Framework Data Provider for MySQL.



 Then you will have a bit different window.



It will automatically get the database name if every thing goes well. Then click next.


In this you need to right a query to get data form the table in your My SQL database. Both the table and the database I have named as the test.  You need to write a select query for the table in the My SQL database. Here my query is "Select * from test"




Then click next. If every thing goes correctly then you will get the next window.


If you want to edit the mapping you can do that by clicking the Edit mapping button. Then click next. You will get a window named Conversion types with out conversion checking. Click next button. Then you will get the following window. keep the automatically checked Run Immediately check box and then click next. At the end you will have the following window and then click Finish.


When you click finish, then the query will be executed and data from My SQL table would be imported to a table name Query (The Default table) in your SQL Server database.

Now all you have to do is check whether the data is being migrated to your SQL Server. Go to the SQL Server and navigate to your relevant database and see. You will have all the data from the specific table in My SQL database being imported to your database.

  That is how data migration from My SQL database to SQL Server is done. So Until the post I'm out of here. Thank you for reading this. Buy.


 Tharindu Senanayake










Monday, September 14, 2015

Enterprise Application Development- Part 1

       As an undergraduate at University of Moratuwa I'm following a course module called Enterprise Application Development. In this course module we will be learning What Enterprise applications are?, what processes do we use to build ERPs? and how to create and deploy an ERP. So I though to share what I learn form Uni with you guys. So lets go in to more detail About today's topic



What is an Enterprise Application

      In the present world human actions are thoroughly based on business transactions. There are lot of companies, businesses an d start ups which try to prevail in this modern corporate world. When the company grows larger and larger, the functionality and the processes conducted in the company grows. This means that the human resource of that company will grow too.
   Now a simple problem arises. Well when the company grows large day by day, controlling processes and handling functionality and human resource become harder and harder. In order to make  this proper and make this easy Enterprise Applications come in to play.  
      So what is an Enterprise Application? There are lot of answers but we can simply say that Enterprise Applications are applications used by large companies or businesses to solve there corporate or business problems. These applications are called as Business Applications as well.These applications are mainly used by large companies and businesses due to some reasons. These applications can't be used by an Individual or a small business.reasons for this are ERP's being,
  1. Complex
  2. Scalable
  3. Destributed
  4. Component Based
  5. Mission Critical

  • Evolution of ERP's 
                     1960s - Inventory Management Control
                     1970s - Material Requirement Planning(MRP)
                     1980s - Manufacturing Resources Planning II (MRP II)
                     1990s - Enterprise Resource Planning (ERP)
                     2000s - Extended ERP(ERP II)
  • Business Environments/Markets using ERPs
                 Defense
                 Automotive
                 Oil and Gass
                 Banking
                 Higher Education and Research
                 Health Care
                 High Tech
                 Industrial Machinary
                 Aerospace
                 Transport and Logistics
                 Shipping
                 Telecommunication
                 Engineering and Construction
                 Chemical
  These are some few examples of business areas or markets where usage of ERPs are really common
  • Integrating and Development
               When we are integrating or developing an ERP we have to focus on lot of key factors and features. When it comes to ERPs we need to focus on satisfying hundred and thousend of separate requirements. ERPs will address all the key functions in the business like
  1. Financial
  2. HR
  3. Engineering
  4. Projects
  5. Manufacturing
  6. Destribution
  7. Maintanence
  8. Sales and Services
  9. Transport

         Also there are some more key functions when it comes to ERPs they are,
  • ERPs should support cross platform networks like internet, intranet and corporate networks
  •  They shouls be Data-centric(Which means that ERPs are mainly data driven or simply based on usage and handling of lot of data )
  • User friendly
  • Must meet all the aspects when it comes to security, administration and maintenance
  • Should work with other ERPs deployed in the organization's system

     These ERPs are really complex. Developing these ERPs means satisfying Hugh number of requirements, but every time we take decisions to develop a requirement other requirements will be affected with that so we need to be really careful when it comes to ERP development Decision making.
     Due to the complexity of ERPs and the large number of requirements being asked to satisfy mostly ERPs are being developed by a group of IT professionals within the company but some times half or the full project is being out sourced.


Saturday, September 12, 2015

What is npm manager - Introduction to Node.js part 2


What is npm?

    Well if you are interested in working with Node.js then you should know and be familiar with npm. npm is short term for Node.js Package Manager. With this developers have the ability to reuses sets of codes not only what they wrote but also what others wrote as well.

 This is the official web page of npm

So if you are using an Mac you can update your npm using the following command

sudo npm install npm -g

Friday, September 11, 2015

Introduction to Node.js - part 1


Why  Node.js

     Hi guys, so I'm starting my blog about technologies related to Information technology. So this will be my first post in this blog. Now you may wonder why I chose to talk about Node.js. For those who are curious I'm an Undergraduate from University of Moratuwa of Faculty of Information Technology. When I was going through internet and having chats with my friends, Node.js often became one interesting subject. So I decided to dedicate my first blog post on Node.js. I this post I will be covering from what is Node.js up to Installation of Node.js. Hopefully other post which will be following this post will go more deep into usage and functionality of Node.js.

 What is Node
      
There are lot of definitions given in internet for node.js. Those definitions include what Node.js is, how it is used, what special functions we can see in node etc. So rather than arguing with others about what the exact definition of Node is, I thought of giving you a simple and basic description about Node. Node is an open-source cross-platform(can be used in many platforms like windows, Linux,Mac etc) environment, which is used for server side application development.Node applications are based on java script and they can be run within Node.js run time. Node is a collaborative project at Linux Foundation.Node is built on Chrome's V8 JavaScript engine(Google V8).
   Node is light weighted and considered to be more efficient. These tasked have been achieved by Node  since it is using an event-driven architecture and non-blocking I/O API which will  optimize an application's throughput and scalability for real-time web applications.Node.js contains a built-in library to allow applications to act as a web server

Why use Node
   I have given the basic introduction about Node. Yup that may do the trick and give you a brief idea but you may wonder among so many server side development options, why should we go and select Node. Lets try and compare Node with some server side languages.
     Node vs PHP
  • In Node we can do separating concerns
  • We could mix content with code in PHP but not in Node
  • PHP has a deep code base than Node
  • In Node if its new code then it means you will have new features
  • Node is way more simple than PHP
  • Node has complexity of closures 
  • In PHP we dont need a client app but in Node we need that
  • service callers are thinner than html-fat PHP calls
  • PHP can co-exist with mysql
  • Node can access databases also it can directly use JSON
  • Coding speed is high in PHP  
   Node vs Java
  • Java has a rock solid foundation than Node
  • Node has Ubiquity
  •  Java has better IDEs than Node
  • Node has a simplified building process by using the same languages
  • Java has remote debugging
  • New Database queries can be easily used in Node
  • Hugh number of libraries in Java than Node
  • Node uses JSON
  • java has a solid engineering than Node
  • Node is faster than Java
  • Java has threads but Node does not
So guys these are some basic compressions and if you want to learn in details about the above features you could check in the following links
  1. http://www.infoworld.com/article/2883328/java/java-vs-nodejs-an-epic-battle-for-developer-mindshare.html(for Java vs Node)  
  2. http://www.infoworld.com/article/2866712/php/php-vs-node-js-an-epic-battle-for-developer-mind-share.html( for Node vs PHP)

Installing Node 

Now you have a basic idea about Node.js.So if you have decided go and check out Node, you need to prepare your desktop machine or your Lap-Top in order to go on and work with Node. 
    First of all we install Node to your working environment. To do that you could go to the following link and get the suitable version of Node to your computer. You need to go to this link to get Node.
  • https://nodejs.org/en/ (Official website of Node.js)
If you are using a different platform than Windows, by clicking on downloads in menu you can access the download table for other platforms.

    When you download the file you will get a exe file named node.exe. When you get that run the exe file.
(The exe file)

When you run the exe file you will get the following window.



    You can then install Node in usual way just by clicking buttons and agreeing the terms and services. When you come to the window where the install button is, press it and you will have the latest version of Node.js installed in your computer or laptop.








   After the installation you will have a separate command prompt for Node. 

   After that you need to check whether you have installed Node properly and you can check the version on Node that you have installed. You have to type node -- version. Then you will get the version you have.


    Now I'm positive that I have successfully installed Node.js inmy computer. Lets check how we can run a Node application. To do that you need to follow the steps mentioned before,

  1.    Open your Node.js command prompt
  2.    Go to the file location from the command prompt(cmd)
  3.    type node your_file_name
  4. press enter






















   Here "cd" command is used to go in to given file directories and "dir" command is used to check the content of the folder. I have typed "node hello.js". With this command I have started running my Node application name hello.js.
    In order to work efficiently in Node.js we need npm manager. I wont be discussing about npm manage in this post.In the up comming next post we will look in to npm manager and we will create our first Node.js application.

To see part to click on the link below

    Introduction to Node.js part 2