Jump to content


Photo

Mudança Mysql Para Sqlserver


  • Faça o login para participar
2 replies to this topic

#1 Renan L. Miranda

Renan L. Miranda

    Normal

  • Usuários
  • 101 posts
  • Sexo:Não informado

Posted 06/05/2010, 13:23

Olá a todos...

Bem....

Desenvolvi um site todo em PHP, e com conexão a base de dados Mysql... Só que descobri que o local de hospedagem é um SQL SERVER... Certo... Oq exatamente tenho que modificar? Código PHP? Estrutura dos Bancos?

Alguém pode me ajudar?

#2 André Manoel

André Manoel

    Doutor

  • Usuários
  • 996 posts
  • Sexo:Masculino
  • Localidade:Brasilia

Posted 06/05/2010, 14:18

1 - Para realizar essa modificação... você terá que alterar todas as tabelas para o formato do SQLServer... que é bem diferente do MySQL.

2 - Depois de alterar as tabelas, você terá que popular(carregar os dados) no novo banco.

3 - Depois você terá que alterar o arquivo de conexão com o banco de dados do seu site.
A conexão para SQLServer muda um pouco.

E por fim... você terá que fazer uma varredura no seu código para verificar se não existem funções do MySQL nos seus arquivos que realizam operações (consultas, exclusões, alterações...) para realizar uma troca das funções para as funções correspondentes no SQLServer...
Iniciando na Ajuda On line...

Posted Image Meu post lhe ajudou? Reputar/votar é uma das formas de agradecer.

#3 Renan L. Miranda

Renan L. Miranda

    Normal

  • Usuários
  • 101 posts
  • Sexo:Não informado

Posted 10/05/2010, 12:41

1 - Para realizar essa modificação... você terá que alterar todas as tabelas para o formato do SQLServer... que é bem diferente do MySQL.

2 - Depois de alterar as tabelas, você terá que popular(carregar os dados) no novo banco.

3 - Depois você terá que alterar o arquivo de conexão com o banco de dados do seu site.
A conexão para SQLServer muda um pouco.

E por fim... você terá que fazer uma varredura no seu código para verificar se não existem funções do MySQL nos seus arquivos que realizam operações (consultas, exclusões, alterações...) para realizar uma troca das funções para as funções correspondentes no SQLServer...


NO CASO... Ele gera assim o SQL..:

/*
SQLyog v4.07
Host - 5.1.30-community-log : Database - oab
*********************************************************************
Server version : 5.1.30-community-log
*/


create database if not exists `oab`;

USE `oab`;

/*Table structure for table `blte_lines` */

drop table if exists `blte_lines`;

CREATE TABLE `blte_lines` (
`line_id` int(11) NOT NULL,
`from_id` int(11) NOT NULL,
`from_name` varchar(64) NOT NULL,
`line_stamp` int(11) NOT NULL,
`line_txt` varchar(255) NOT NULL,
`line_biu` varchar(3) NOT NULL,
`line_clr` varchar(32) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1 MAX_ROWS=15000;

/*Data for the table `blte_lines` */

/*Table structure for table `blte_online` */

drop table if exists `blte_online`;

CREATE TABLE `blte_online` (
`usr_id` int(11) NOT NULL,
`usr_name` varchar(64) NOT NULL,
`usr_ip` varchar(15) NOT NULL,
`rtime` int(11) NOT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1 MAX_ROWS=15000;

/*Data for the table `blte_online` */

/*Table structure for table `config` */

drop table if exists `config`;

CREATE TABLE `config` (
`admin` varchar(100) NOT NULL,
`admine` varchar(255) NOT NULL,
`adminl` varchar(15) NOT NULL,
`admins` varchar(15) NOT NULL,
`nsite` varchar(100) NOT NULL,
`usite` varchar(255) NOT NULL,
`fonte` varchar(50) NOT NULL,
`tfonte` varchar(2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

/*Data for the table `config` */

insert into `config` values ('Renan Miranda','webmaster.ap@hotmail.com','admin','admin','OAB - Amapá','www.oabap.gov.br','Verdana','1');

/*Table structure for table `tabsnews_cats` */

drop table if exists `tabsnews_cats`;

CREATE TABLE `tabsnews_cats` (
`id` int(3) NOT NULL AUTO_INCREMENT,
`cat` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

/*Data for the table `tabsnews_cats` */

insert into `tabsnews_cats` values (1,'Geral News');

/*Table structure for table `tabsnews_news` */

drop table if exists `tabsnews_news`;

CREATE TABLE `tabsnews_news` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`titulo` varchar(200) NOT NULL DEFAULT '',
`desc1` longtext NOT NULL,
`desc2` longtext,
`imagem1` varchar(255) DEFAULT NULL,
`imagem2` varchar(255) DEFAULT NULL,
`categoria` int(3) NOT NULL DEFAULT '0',
`data` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

/*Data for the table `tabsnews_news` */

/*Table structure for table `users` */

drop table if exists `users`;

CREATE TABLE `users` (
`id` tinyint(3) NOT NULL AUTO_INCREMENT,
`nome` varchar(150) NOT NULL,
`email` varchar(255) NOT NULL,
`login` varchar(15) NOT NULL,
`senha` varchar(15) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

/*Data for the table `users` */

insert into `users` values (1,'Renan Miranda','webmaster.ap@hotmail.com','admin','admin');

::::: Como ficaria em SQLServer ?




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq