Click here to Skip to main content
12,079,202 members (26,390 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: SQL Server
Hi ALL,


I have a MSSQL server database with loads of Tables,Views and Stored procedures. I tried to convert with a tool. But it converted tables only(not sp or view).Let me know a way to migrate whole the db to mysql.


Plz help me.

thanks,
Posted 10-Dec-12 0:30am
Comments
Nirali R shah 9-Mar-15 3:42am
   
hello,
How to convert all tables, views , stored procedure from Microsoft SQL Sever to MYSQL.

can any one help plz...
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

CREATE PROCEDURE SPR_AgendaObter
(
@IdAgenda int
,@Contrato varchar(10) = null
,@IdCondominio int = null
,@IdAgendaStatus int=null
)
As
Begin
IF @IdAgendaStatus IS NULL
BEGIN
SELECT age.IdAgenda
,age.IdCondominio
,upper(pes.Nome) Condominio
,age.Contrato
,age.VigenciaInicial
,age.VigenciaFim
,age.IdPeriodo
,age.IdTurno
,age.IdAgendaStatus
,sta.Descricao DescricaoStatus
,age.FlagAtiva
,age.FlagSituacao
,age.IdTransacao
,age.DataCadastro
FROM Agenda age
LEFT JOIN AgendaStatus sta on sta.CodAgendaStatus=age.IdAgendaStatus
LEFT JOIN Pessoa pes on pes.IdPessoa=age.IdCondominio and CodigoProprietario='C'
WHERE age.FlagSituacao = 1
AND age.IdAgendaStatus<>1 --Em Andamento
AND ((@IdAgenda is null) or (age.IdAgenda = @IdAgenda))
AND ((@IdCondominio is null) or (age.IdCondominio = @IdCondominio))
AND ((@Contrato is null) or (Upper(age.Contrato) like '%' + Upper(@Contrato) + '%'))
End
ELSE
BEGIN
SELECT age.IdAgenda
,age.IdCondominio
,upper(pes.Nome) Condominio
,age.Contrato
,age.VigenciaInicial
,age.VigenciaFim
,age.IdPeriodo
,age.IdTurno
,age.IdAgendaStatus
,sta.Descricao DescricaoStatus
,age.FlagAtiva
,age.FlagSituacao
,age.IdTransacao
,age.DataCadastro
FROM Agenda age
LEFT JOIN AgendaStatus sta on sta.CodAgendaStatus=age.IdAgendaStatus
LEFT JOIN Pessoa pes on pes.IdPessoa=age.IdCondominio and CodigoProprietario='C'
WHERE age.FlagSituacao = 1
AND age.IdAgendaStatus=1 --Em Andamento
AND ((@IdAgenda is null) or (age.IdAgenda = @IdAgenda))
AND ((@IdCondominio is null) or (age.IdCondominio = @IdCondominio))
AND ((@Contrato is null) or (Upper(age.Contrato) like '%' + Upper(@Contrato) + '%'))
END
END
  Permalink  
Comments
CHill60 19-Jan-16 10:34am
   
In what way is this relevent to this 3 year old question?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160212.1 | Last Updated 18 Jan 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100