原因:
因为框架某些字段大写有时候不被正确识别,所以字段都修改成小写;
特别说明:因为这里只有表,没有视图,存储过程等等其它所以我可以直接这么写;
步骤:
1.导出结构语句
2.
执行C# 脚本,替换里面2个文件的位置;
FileStream fs = File.Create("D:\1111.txt"); StreamWriter sw = new StreamWriter(fs); FileStream fileStream = File.OpenRead("D:\skxscm.sql"); StreamReader sr = new StreamReader(fileStream); while (sr.Peek() >= 0) { string l_strTest = sr.ReadLine(); if (l_strTest.StartsWith(" `")) { l_strTest = l_strTest.Substring(0,l_strTest.IndexOf("`", 3)).ToLower() + l_strTest.Substring(l_strTest.IndexOf("`", 3)); Console.WriteLine(l_strTest); } sw.WriteLine(l_strTest); } fs.Close(); sw.Close(); fileStream.Close(); sr.Close(); Console.ReadKey();
其它失败方法:
a.直接修改information_schema库的数据,因为是视图所以无法修改;好像跟SQLServer不一样
b.利用information_schema 中的表生成SQL语句,因为字段的其它信息无法被照顾所以放弃
参考资料:
http://blog.csdn.net/qq_31215927/article/details/52902886