Wednesday, August 29, 2007

The OSQL utility

Well this is more of a tip a smart tip is guess we came across this scenario where we were working a interface between Navision database for the financials and 17 other POS databases from where the daily sales was imported into navision.

osql is a sql client with a command line interface it is very similar to what query analyzer does in functionality i.e it takes a SQL batch and passes it on to the relevant server just that it accepts command line parameters which makes it that useful.

The interface was based on SQL procedures and everytime there was any change required someone was required to physically connect to these 17 servers manually and update the scripts one by one it was really painful, it was then that we thought of using a shortcut we just made one batch file with connection information to all the 17 stores and then provided a file name as a parameter to osql this file contained the batch we wanted to execute on all the servers the syntax was like this

osql -S192.168.10.3 -Usa -Psk74fa5z -dAlainMall -iBatch.sql -n

The parameters help can be got on the osql command line "batch.sql" was the file we would place our sql code into and it would execute on all the servers in the right databases.


Anonymous said...

I’m not that much of a internet reader to be honest but
your blogs really nice, keep it up! I'll go ahead and bookmark your site to come back later. All the best

Feel free to visit my page :: zöliakie

Anonymous said...

Thanks for your personal marvelous posting! I genuinely enjoyed reading it, you happen to be a great author.
I will be sure to bookmark your blog and will eventually come back later on.
I want to encourage yourself to continue your great work, have a nice afternoon!

Also visit my website ... low carb drink

Anonymous said...

Someone necessarily help to make significantly articles I'd state. That is the very first time I frequented your website page and to this point? I amazed with the research you made to create this actual submit extraordinary. Magnificent activity!

Also visit my web site investieren in wiesbaden

Anonymous said...

Its like you read my mind! You seem to know so much about this, like you
wrote the book in it or something. I think that you
can do with a few pics to drive the message home a bit, but other than that,
this is wonderful blog. A great read. I will definitely be back.

Feel free to surf to my weblog ... Steinzeit-Diät Rezepte