Search

Saturday, July 30, 2011

OSQL

If you want to rund code at a SQL-server without having access to EM or QA you can use OSQL. This could be f ex MSDE. There is also a lot of applications with built in SQL engines but no grafic layout.

In commando prompt you can wright: osql /?
This will show your options. To make a quick check copy this code into your own pc:s cmd:

osql -S 131.97.101.86,1520 -U sa -P yuqiong -q "select @@version"

This code will access our first instance on the cluster and asks it wich version it has. If you are logged on with your NT-account you can change user and password to -E for windows-login instead( no need for password ). This is case sensitive!

If you have a script thats need to be run type:

osql -S 131.97.101.86,1520 -U sa -P yuqiong -i test.sql

No comments:

Post a Comment