Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
olibara
Yak Posting Veteran
94 Posts |
Posted - 2010-11-21 : 04:00:47
|
| HelloI'm making a tool to transfer parts of an MS SQL db to a MySql DBFor tables it's already doneBut now I have to transfer some viewHow can I retrieve the design syntax of existing views ?Thanks for any help |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-11-21 : 04:04:31
|
| you can script the view out from management studio by right clicking on view and selecting open script as create------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-11-21 : 09:34:34
|
quote: Originally posted by olibara HelloI'm making a tool to transfer parts of an MS SQL db to a MySql DBFor tables it's already doneBut now I have to transfer some viewHow can I retrieve the design syntax of existing views ?Thanks for any help
Out of curiosity does that tool converts MS SQL specific syntax and data types to MySql flavour?PBUH |
 |
|
|
olibara
Yak Posting Veteran
94 Posts |
Posted - 2010-11-21 : 11:26:51
|
quote: Out of curiosity does that tool converts MS SQL specific syntax and data types to MySql flavour?
More or less : I do not have very specific needs but with a little effort it can do it easily for about 95% I think with some shortcut as for currency and other exotic feature |
 |
|
|
olibara
Yak Posting Veteran
94 Posts |
Posted - 2010-11-21 : 11:55:40
|
quote: Originally posted by Sachin.NandOut of curiosity does that tool converts MS SQL specific syntax and data types to MySql flavour?PBUH
Hello here is a example of the actual "conversion" switch (Type) { case "int": sb.AppendFormat(" {0} int(10) default NULL", ColName); break; case "bigint": sb.AppendFormat(" {0} bigint(10) default NULL", ColName); break; case "smalldatetime": case "datetime": sb.AppendFormat("{0} DateTime default NULL", ColName); break; case "bit": sb.AppendFormat("{0} bit default NULL", ColName); break; case "nvarchar": case "ntext": sb.AppendFormat("{0} Varchar({1}) default NULL", ColName,Max); break; case "char": sb.AppendFormat("{0} char({1}) default NULL", ColName,Max); break; case "decimal": sb.AppendFormat("{0} Decimal default NULL", ColName); break; case "real": sb.AppendFormat("{0} real default NULL", ColName); break; case "money": sb.AppendFormat("{0} Decimal default NULL", ColName); break; default: MessageBox.Show("UnKnown : " + Type); break; } |
 |
|
|
|
|
|