my sql code to sql
-
Hi i created a web service in PHP using mysql now i wan to change the same into SQL is there any option. --------------------------------------------------------------- -- phpMyAdmin SQL Dump -- version 3.1.3.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Mar 21, 2013 at 11:46 AM -- Server version: 5.5.16 -- PHP Version: 5.2.9 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `lt` -- -- -------------------------------------------------------- -- -- Table structure for table `user_details` -- CREATE TABLE IF NOT EXISTS `user_details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `First_Name` varchar(255) NOT NULL, `Last_Name` varchar(255) NOT NULL, `Middle_Name` varchar(255) NOT NULL, `Door` varchar(255) NOT NULL, `Street` varchar(255) NOT NULL, `Building` varchar(255) NOT NULL, `Area` varchar(255) NOT NULL, `Theil` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Dumping data for table `user_details` --
-
Hi i created a web service in PHP using mysql now i wan to change the same into SQL is there any option. --------------------------------------------------------------- -- phpMyAdmin SQL Dump -- version 3.1.3.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Mar 21, 2013 at 11:46 AM -- Server version: 5.5.16 -- PHP Version: 5.2.9 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `lt` -- -- -------------------------------------------------------- -- -- Table structure for table `user_details` -- CREATE TABLE IF NOT EXISTS `user_details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `First_Name` varchar(255) NOT NULL, `Last_Name` varchar(255) NOT NULL, `Middle_Name` varchar(255) NOT NULL, `Door` varchar(255) NOT NULL, `Street` varchar(255) NOT NULL, `Building` varchar(255) NOT NULL, `Area` varchar(255) NOT NULL, `Theil` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Dumping data for table `user_details` --
MySQL is basically SQL. Just try it out and correct the errors you stumble upon.
cheers Marco Bertschi
Software Developer & Founder SMGT Web-Portal CP Profile | Twitter | Facebook | SMGT Web-Portal
FizzBuzz - Gary Wheeler
-
Hi i created a web service in PHP using mysql now i wan to change the same into SQL is there any option. --------------------------------------------------------------- -- phpMyAdmin SQL Dump -- version 3.1.3.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Mar 21, 2013 at 11:46 AM -- Server version: 5.5.16 -- PHP Version: 5.2.9 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `lt` -- -- -------------------------------------------------------- -- -- Table structure for table `user_details` -- CREATE TABLE IF NOT EXISTS `user_details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `First_Name` varchar(255) NOT NULL, `Last_Name` varchar(255) NOT NULL, `Middle_Name` varchar(255) NOT NULL, `Door` varchar(255) NOT NULL, `Street` varchar(255) NOT NULL, `Building` varchar(255) NOT NULL, `Area` varchar(255) NOT NULL, `Theil` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Dumping data for table `user_details` --
Aren't there any tools for migrating the data from MySQL to Microsoft SQL Server? That would be the easiest thing. You cannot just load the backup from MySQL into SQL Server: all table/column names are escaped with
`
- SQL Server uses[]
. E.g.`user_details`
=>[user_details]
. If the name does not contain spaces or is a reserved word, you could remove the quotes. And before loading the data into the table, you must do a SET IDENTITY_INSERT [user_details] ON (and switch it off afterwards). I'd also suggest to change the varchar into nvarchar: that safely allows for national characters.