Generally everybody has a basic way of proceeding at the working space. While working everyday the developers work on a planned job everyday. This includes pulling out the information’s out of Oracle database and then afterwards dumping them into Microsoft SQL table which is on one of the local IIS Web server. Then the team has in their hand a script on the remote LAMPP Web server that queries the MSSQL table and afterward shows results on the Web site.
However sometimes the results can be a bit undependable and slow as because of the different location of Web server and the MSSQL server. It becomes a situation of crisis sometimes when the network connection to IIS server or the server itself becomes down. In that scenario sometimes it is not even possible for the team to retrieve any data from the MSSQL sever.
While working on the scripts every developer I guess sometimes goes through certain critical situations. Generally there are certain tips for a guy who is working on a script to retrieve the information’s needed out of the MSSQL table to create afterwards a new table in the MYSQL server that resides on the same server of the website.
Firstly what needs to be done is to find out a way to get some information about the MSSQL table and its column, for doing that following query is helpful.
SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ‘{$table_name}’ ORDER BY ORDINAL_POSITION ASC This query in turn will put the name of the column, the data type and the maximum length of the column from the MSSQL table’s column itself. After that one would want to build upon the queries that will create a new MySQL database and table. One should try these following while getting started in it: $cols = array(); while($r = mssql_fetch_assoc($sql,$mslink)) { $cols[$r['COLUMN_NAME']] = $r['COLUMN_NAME'].’ ‘.$r['DATA_TYPE']; $tmplen = trim($r['CHARACTER_MAXIMUM_LENGTH']); $cols[$r['COLUMN_NAME']] .= (!empty($tmplen)) ? ‘(‘.$tmplen.’)’ : ”; } mssql_free_result($sql); $sql = “CREATE DATABASE $dbname”; if(mysql_query($sql,$mylink)) { $sql = “CREATE TABLE $tname “; $sql .= implode(“,\n”,$cols); /* If you have specific indices to add, you can add a line of code here to do that. */ $sql .= ‘)’; /* print(“We are preparing to run the following query to create the new table:\n”.$sql); */ if(mysql_query($sql,$mylink)) { print(‘We successfully created the table.’); } else { print(‘There was an error creating the table. ‘.mysql_error()); } } else { print(‘There was an error creating the database. ‘.mysql_error()); }A new table has to be crated by now. But it should be noted that MSSQL does offer some data types that are much at a gap from those offered in MySQL. So therefore if someone’s MSSQL table includes any columns with data types that aren’t going with MySQL, they may feel the need to write a function to deal with that. For example, the MS SQL “currency” data type may feel the need of conversion to a decimal or float data type in the new MySQL table.







Thank you for the good writeup. It in reality was a amusement account it. Glance complicated to far added agreeable from you! By the way, how could we communicate?
I dig that post, enjoyed that all alone respect it in behalf of putting up.
Thank you for all of the efforts on this blog. Kate really loves conducting investigations and it’s really easy to see why. A number of us hear all of the powerful tactic you convey helpful suggestions via this web blog and as well improve participation from visitors on the area of interest so my daughter is always becoming educated a lot of things. Take advantage of the remaining portion of the new year. You have been doing a fabulous job.
I am curious to find out what blog system you are using? I’m having some minor security issues with my latest website and I would like to find something more safeguarded. Do you have any suggestions?
Very nice layout and wonderful content, what else we require : D.
Thanks for taking the time to talk about this, I feel strongly about it and like mastering far more on this subject. If achievable, as you acquire experience, would you thoughts updating your blog with a lot more details? Its very helpful for me.
It’s scarce for me to determine anything on the web that is as engaging and intriguing as what you have got here. Your page is sweet, your artwork are fantastic, and what’s much more, you use reference which are appropriate to what you’re saying. You’re definitely one in a million, wonderful job!
I not to mention my friends have already been examining the nice helpful tips on your web page and suddenly I had an awful suspicion I had not expressed respect to the web site owner for them. Most of the young men ended up consequently passionate to study all of them and have in effect definitely been making the most of those things. Many thanks for really being indeed helpful and then for getting this sort of ideal issues millions of individuals are really desperate to know about. Our own honest regret for not expressing appreciation to you sooner.
Oh my goodness! a tremendous article dude. Thanks Nonetheless I am experiencing difficulty with ur rss . Don’t know why Unable to subscribe to it. Is there anybody getting equivalent rss problem? Anyone who is aware of kindly respond. Thnkx
Hi,
Thanks for your valuable comment.
We hope, now you can subscribe our RSS feed.
Please give us your feedback.
A great read. I will certainly be back. Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! By the way, how can we communicate?
Hello,
Thanks for your comment.
You can contact us via http://www.maketick.com/contact-us, Or you can find us at Facebook (http://www.facebook.com/maketick) , Twitter (http://www.twitter.com/maketick).
I must say, you’ve got among the finest blogs Ive seen in a long time. What I wouldn’t give to have the ability to create a blog that’s as interesting as this. I guess I’ll just have to keep reading yours and hope that one day I can write on a subject with as considerably information as you’ve got on this one!
Pingback: i like reading
Really nice design and style and wonderful subject material , hardly anything else we require : D.
I got what you mean , thanks for posting .Woh I am lucky to find this website through google. “Remember that what you believe will depend very much on what you are.” by Noah Porter.
Good read … headline catchy … good points, some of which I have learned along the way as well (humility, grace, layoff the controversial stuff). Will share with my colleagues at work as we begin blogging from a corporate perspective. Thanks!
This is my new I’ve visited here. I found a lot of interesting information within your blog. In the tons of comments inside your posts, I guess Im not by yourself! continue the impressive work.
Dear Web site owner. My partner and i actually enjoy this post and the internet site all in all! Your piece of writing is really plainly composed as well as simply understandable. Your current Blog design is awesome as well! Would be awesome to know where I are able obtain it. Please maintain up the very good job. We all require far more such website owners like you on the net and much fewer spammers. Fantastic mate!
I do not even know how I ended up here, but I thought this post was great. I do not know who you are but definitely you’re going to a famous blogger if you aren’t already
Cheers!