Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts

Monday, March 12, 2012

osql vs. QA and extended characters

Hi, I have some sql commands I incorporate into an install and I've been
using scripts and osql.exe to perform these with generally good results.
A recent addition to these installs is a script that populates a table
of usernames and encryped passwords, and this is where I'm having
trouble. If I run a script in Query Analyzer that contains this line:
insert into operator (op_code, password, first_name, last_name,
security, operator, salespoint) values ('ADMIN', '??', 'ADMIN',
'ADMIN', 9, 'SYSTEM', 'SYSTEM')
I get predictable results and the encrypted password gets correctly
decrypted in our application.
If I run the very same script using osql like this:
osql.exe -E -i MyScript.sql -o "Output.txt"
The password doesn't end up in the database as '??', it seems to get
changed to '?+-' which obviously wouldn't decrypt correctly in the
application.
So this makes me think there's some kind of translation going on with
these extended characters when running the script via osql. Anyone know
how I can achieve the same results with osql as QA? I'm hoping there's a
switch or something that will do the trick. Thanks!
Matt
MattB wrote:
> Hi, I have some sql commands I incorporate into an install and I've
> been using scripts and osql.exe to perform these with generally good
> results.
> A recent addition to these installs is a script that populates a table
> of usernames and encryped passwords, and this is where I'm having
> trouble. If I run a script in Query Analyzer that contains this line:
> insert into operator (op_code, password, first_name, last_name,
> security, operator, salespoint) values ('ADMIN', '??', 'ADMIN',
> 'ADMIN', 9, 'SYSTEM', 'SYSTEM')
> I get predictable results and the encrypted password gets correctly
> decrypted in our application.
> If I run the very same script using osql like this:
> osql.exe -E -i MyScript.sql -o "Output.txt"
> The password doesn't end up in the database as '??', it seems to
> get changed to '?+-' which obviously wouldn't decrypt correctly in
> the application.
> So this makes me think there's some kind of translation going on with
> these extended characters when running the script via osql. Anyone
> know how I can achieve the same results with osql as QA? I'm hoping
> there's a switch or something that will do the trick. Thanks!
> Matt
See this page:
http://www.windowsitpro.com/SQLServe...ver_37470.html
David Gugick
Imceda Software
www.imceda.com
|||David Gugick wrote:
> MattB wrote:
>
> See this page:
> http://www.windowsitpro.com/SQLServe...ver_37470.html
>
Great. Thanks!
Matt

Wednesday, March 7, 2012

osql command reference?

Hi!
I have been looking for a complete command reference to osql. A document
that describes all possible SQL commands that you acn use. Unfortunately,
I seem too stupid :/
I haven't found:
* the complete desciption of BACKUP and RESTORE
* a way to show the table definitions.
TIA,
Stefan
At command prompt, run the following command and it will show you all
switches available for OSQL.
OSQL /?
Also see the topic "osql utility" in SQL Server 2000 Books Online.
Similarly, SQL Server Books Online has complete documentation on BACUP and
RESTORE commands.
sp_help will give you table definitions and you can generate table creation
scripts in Enterprise Manager.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Stefan M. Huber" <looseleaf@.gmx.net> wrote in message
news:opsbdo75yjs9ddfw@.news.individual.de...
Hi!
I have been looking for a complete command reference to osql. A document
that describes all possible SQL commands that you acn use. Unfortunately,
I seem too stupid :/
I haven't found:
* the complete desciption of BACKUP and RESTORE
* a way to show the table definitions.
TIA,
Stefan
|||On Mon, 19 Jul 2004 11:09:11 +0100, Narayana Vyas Kondreddi
<answer_me@.hotmail.com> wrote:

> At command prompt, run the following command and it will show you all
> switches available for OSQL.
> OSQL /?
These, I know, thanks

> Also see the topic "osql utility" in SQL Server 2000 Books Online.
> Similarly, SQL Server Books Online has complete documentation on BACUP
> and RESTORE commands.

> sp_help will give you table definitions and you can generate table
> creation scripts in Enterprise Manager.
Thanks, that helped me to find my way through. I found an online reference
at
<http://manuals.sybase.com/onlinebook...sg1250e/sqlug/>.
Stefan
|||Hi,
Books online is the best option to learn all commands and usage.
http://www.microsoft.com/sql/techinf...2000/books.asp
* the complete desciption of BACKUP and RESTORE
See backup and Restore in books online
* a way to show the table definitions.
sp_help <table_name>
* OSQL
See OSQL in books online
Thanks
Hari
MCDBA
"Stefan M. Huber" <looseleaf@.gmx.net> wrote in message
news:opsbdo75yjs9ddfw@.news.individual.de...
> Hi!
> I have been looking for a complete command reference to osql. A
document
> that describes all possible SQL commands that you acn use. Unfortunately,
> I seem too stupid :/
> I haven't found:
> * the complete desciption of BACKUP and RESTORE
> * a way to show the table definitions.
> TIA,
> Stefan
|||The online reference you found is for Sybase and is not valid for Microsoft
SQL Server. Follow Hari's link.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Stefan M. Huber" <looseleaf@.gmx.net> wrote in message
news:opsbdq5udms9ddfw@.pluto...
On Mon, 19 Jul 2004 11:09:11 +0100, Narayana Vyas Kondreddi
<answer_me@.hotmail.com> wrote:

> At command prompt, run the following command and it will show you all
> switches available for OSQL.
> OSQL /?
These, I know, thanks

> Also see the topic "osql utility" in SQL Server 2000 Books Online.
> Similarly, SQL Server Books Online has complete documentation on BACUP
> and RESTORE commands.

> sp_help will give you table definitions and you can generate table
> creation scripts in Enterprise Manager.
Thanks, that helped me to find my way through. I found an online reference
at
<http://manuals.sybase.com/onlinebook...sg1250e/sqlug/>.
Stefan
|||On Mon, 19 Jul 2004 15:57:16 +0530, Hari Prasad
<hari_prasad_k@.hotmail.com> wrote:

> Hi,
> Books online is the best option to learn all commands and usage.
> http://www.microsoft.com/sql/techinf...2000/books.asp
> * the complete desciption of BACKUP and RESTORE
> See backup and Restore in books online
> * a way to show the table definitions.
> sp_help <table_name>
> * OSQL
> See OSQL in books online
Thanks!
And while my other link isn't for MSDE, most of the things discussed there
work in MSDE as well
Stefan
|||osql is primarily a utility for running Transact-SQL statements on an
instance of SQL Server, including MSDE 2000. The primary reference for most
of the statements you can run using osql is the Transact-SQL Reference in
the SQL Server 2000 Books Online.
You can download the latest version of the SQL Server 2000 Books Online
from:
http://www.microsoft.com/sql/techinf...2000/books.asp
The latest version of the SQL Server 2000 Books Online is also published in
the MSDN Library at:
http://msdn.microsoft.com/library/?u...asp?frame=true
These are topics about running osql that are in the copy of the Books Online
in MSDN:
http://msdn.microsoft.com/library/de...asp?frame=true
http://msdn.microsoft.com/library/?u...asp?frame=true
This is the start of the Transact-SQL Reference in the MSDN copy of the
Books Online:
http://msdn.microsoft.com/library/de...asp?frame=true
Alan Brewer [MSFT]
Lead Programming Writer
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights

osql batch

Hi
I want to run a batch file containg osql commands but do not want the user
to be able to see the sa password. Is there any way of doing this?
Thanks> I want to run a batch file containg osql commands but do not want the user
> to be able to see the sa password. Is there any way of doing this?
Use trusted connection (-E parameter) instead of sql login/password.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||Thanks
"Dejan Sarka" wrote:
> > I want to run a batch file containg osql commands but do not want the user
> > to be able to see the sa password. Is there any way of doing this?
> Use trusted connection (-E parameter) instead of sql login/password.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
>
>

Saturday, February 25, 2012

osql batch

Hi
I want to run a batch file containg osql commands but do not want the user
to be able to see the sa password. Is there any way of doing this?
Thanks
> I want to run a batch file containg osql commands but do not want the user
> to be able to see the sa password. Is there any way of doing this?
Use trusted connection (-E parameter) instead of sql login/password.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
|||Thanks
"Dejan Sarka" wrote:

> Use trusted connection (-E parameter) instead of sql login/password.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
>
>

osql batch

Hi
I want to run a batch file containg osql commands but do not want the user
to be able to see the sa password. Is there any way of doing this?
Thanks> I want to run a batch file containg osql commands but do not want the user
> to be able to see the sa password. Is there any way of doing this?
Use trusted connection (-E parameter) instead of sql login/password.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||Thanks
"Dejan Sarka" wrote:

> Use trusted connection (-E parameter) instead of sql login/password.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
>
>