Menu

Search



OSQL Command Syntax for Running a SQL Script

New Boundary Support
Prism Asset Manager

 

New Boundary Technical Support occasionally provides SQL scripts for modifying the Prism Channel database directly. An example of such a script is the one used to add the Dell Battery Recall Report to the Console.

 

Customers using full SQL Server can use the Query Analyzer tool for this operation. Customers using MSDE installed by Prism may not have a graphical tool and will have to use OSQL commands in a DOS window. This article explains the correct syntax for the OSQL command. 

 

Notes:

·         The OSQL command must be run on the SQL Server, which may or may not be the same box as the Prism server. Open a command window (DOS window) to run the command.

·         Save the SQL script that you received from NBT Technical Support locally on the SQL server before beginning.

·         Make note of the Channel database name before beginning. You can get this from the Prism Server’s registry: Hkey_Local_Machine\Software\Lanovation\Prism Deploy\Server Channels\<your Channel’s GUID>, value=Channel Database Name.

·         Make note of the SQL server name and instance before beginning. You can get this from the Prism Server’s registry: Hkey_Local_Machine\Software\Lanovation\Prism Deploy\Server Channels\<your Channel’s GUID>, value= Database Server.

 

There are two authentication methods for using OSQL to modify the database: Windows (trusted) authentication and SQL authentication. If you want to use Windows authentication, you must be logged into the SQL server with an account that has rights to modify the SQL database.

 

If you want to use SQL authentication, you must know and remember the “sa” account password you entered when Prism initially installed MSDE. If MSDE was installed outside of the Prism installation, then you must know both the “sa” account name password that was used for the MSDE installation.

 

Syntax for Windows authentication:

osql –S <enter database server name from registry> –d <enter database name from registry> -i<path to .sql file> –E

 

Example:

osql –S PrismSQL\SW_DEPLOY_SERVER –d Prism_Deploy_Sample_E557A70E-7566-4265-8FA2-2A334B9D79D8 –iC:\DellBatteryRecall.sql -E

 

 

Syntax for SQL authentication:

osql –S <enter database server name from registry> –d <enter database name from registry> -i<path to .sql file> –U sa

(You will be prompted for the “sa” account password.)

 

Example:

osql –S PrismSQL\SW_DEPLOY_SERVER –d Prism_Deploy_Sample_E557A70E-7566-4265-8FA2-2A334B9D79D8 –iC:\DellBatteryRecall.sql –U sa

 

 

Explanation of parameters

Parameters are case-sensitive.

 

-S refers to SQL database server.

-d refers to the Channel database name

-i refers to the input file (.sql) received from Technical Support. There is no space between that parameter and the path to the .sql file.

 


Also In This Category


On a scale of 1-5, please rate the helpfulness of this article


Not Helpful
Very Helpful
Optionally provide your comments to help us improve this article...

Thank you for your feedback!

Add Your Comments
Name:
Email Address:
RadEditor - HTML WYSIWYG Editor. MS Word-like content editing experience thanks to a rich set of formatting tools, dropdowns, dialogs, system modules and built-in spell-check.
RadEditor's components - toolbar, content area, modes and modules
   
Toolbar's wrapper  
Content area wrapper
RadEditor's bottom area: Design, Html and Preview modes, Statistics module and resize handle.
It contains RadEditor's Modes/views (HTML, Design and Preview), Statistics and Resizer
Editor Mode buttonsStatistics moduleEditor resizer
 
 
RadEditor's Modules - special tools used to provide extra information such as Tag Inspector, Real Time HTML Viewer, Tag Properties and other.
   
Verification Code:
Details
Last Modified: 15 Years Ago
Last Modified By: New Boundary Support
Type: INFO
Article not rated yet.
Article has been viewed 76.8K times.
Options
Customer Support Software By InstantKB 2015-2
Execution: 0.000. 9 queries. Compression Disabled.