# Osql/sqlcmd Problem

**URL:** https://www.finalbuilder.com/forums/t/osql-sqlcmd-problem/7490
**Category:** Discussion
**Created:** [May 22, 2024, 12:54pm UTC](https://www.finalbuilder.com/forums/t/osql-sqlcmd-problem/7490 "2024-05-22T12:54:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bernd.maierhofer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bernd.maierhofer](https://www.finalbuilder.com/forums/u/bernd.maierhofer)
#### Post date: [May 22, 2024, 12:54pm UTC](https://www.finalbuilder.com/forums/t/osql-sqlcmd-problem/7490/1 "2024-05-22T12:54:37Z")

</div>

Hi + tx for support!  
I added an MSSQLExecute SQL Action that reads a SQL stamtemnet from a file and writes the output to another file. This works ok with osql. However, when I check the “unicode” output, I get

```auto
Microsoft (R) SQL Server Command Line Tool
Version 16.0 NT
Copyright (c) 2015 Microsoft. All rights reserved.

Note: osql does not support all features of SQL Server 2022.
Use sqlcmd instead. See SQL Server Books Online for details.

usage: osql [-U login id] [-P password]
  [-S server] [-H hostname] [-E trusted connection]
  [-d use database name] [-l login timeout] [-t query timeout]
  [-h headers] [-s colseparator] [-w columnwidth]
  [-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
  [-L list servers] [-c cmdend] [-D ODBC DSN name]
  [-q "cmdline query"] [-Q "cmdline query" and exit]
  [-n remove numbering] [-m errorlevel]
  [-r msgs to stderr] [-V severitylevel]
  [-i inputfile] [-o outputfile]
  [-p print statistics] [-b On error batch abort]
  [-X[1] disable commands [and exit with warning]]
  [-O use Old ISQL behavior disables the following]
      <EOF> batch processing
      Auto console width scaling
      Wide messages
      default errorlevel is -1 vs 1
  [-? show syntax summary]
Execute failed, return code: 1

```

If i use sqlcmd as client I get:  
`Sqlcmd: 'C:\SHARE\SIGNAGE\Deploy\SQL\xyz.sql': Unexpected argument. Enter '-?' for help.`  
where xyz.sql is the outputfile.

Maybe I should add, that this is with SQL2022.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [May 22, 2024, 10:29pm UTC](https://www.finalbuilder.com/forums/t/osql-sqlcmd-problem/7490/2 "2024-05-22T22:29:03Z")

</div>

osql and isql are deprecated, so sqlcmd is the tool to use.

I can reproduce the unicode issue, looking into it

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [May 22, 2024, 11:29pm UTC](https://www.finalbuilder.com/forums/t/osql-sqlcmd-problem/7490/3 "2024-05-22T23:29:14Z")

</div>

This build has a fix for sqlcmd and the unicode option

[https://downloads.finalbuilder.com/downloads/finalbuilder/800/FB800\_3365.exe](https://downloads.finalbuilder.com/downloads/finalbuilder/800/FB800_3365.exe)

---

<div class="post-metadata">

### Author: ![bernd.maierhofer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/b/8edcca/32.png) [@bernd.maierhofer](https://www.finalbuilder.com/forums/u/bernd.maierhofer)
#### Post date: [May 23, 2024, 5:08am UTC](https://www.finalbuilder.com/forums/t/osql-sqlcmd-problem/7490/4 "2024-05-23T05:08:16Z")

</div>

Thank you for your immediate support! I appreciate that.
