Detailed description of iSQL Command Parameters

Source: Internet
Author: User
Tags truncated

Content: 1,
You are using a Windows Account to log on to the ms SQL Server on your PC. Please use iSQL-e
Assume that ntuser1 of the Windows Account needs to log on to the ms SQL Server.
1. log in to Windows2000 Professional with the NT account ntuser1, not the ms SQL Server.
2. iSQL-S server-e

Ii. SQL Server account:
1. Set authentication to SQL Server and windows.
2. iSQL-u login_id-P password-S server iSQL [-?] | [-L] | [
{-U login_id [-P Password]} |-e}
[-S SERVER_NAME] [-H wksta_name] [-D db_name]
[-L time_out] [-T time_out] [-H headers]
[-S col_separator] [-W column_width] [-A packet_size]
[-E] [-x max_text_size] [-C prepare _end] [-Q "query"] [-Q "query"]
[-N] [-M error_level] [-r {0 | 1}]
[-I input_file] [-O output_file] [-p] [-B] [-O]-? Displays the syntax Summary of the iSQL switch.
-L lists the names of the Servers configured locally and the servers broadcast on the network.
-U login_id: User Logon ID. The logon ID is case sensitive.
-P password is the password specified by the user. If not
-P option. iSQL prompts you to enter the password. If the-P option is used at the end of the command prompt without a password, iSQL uses the default password (null ). The password is case sensitive. The isqlpassword environment variable allows you to set the default password for the current session. Therefore, you do not need to set a password in the batch file through hard encoding. If no password is specified for the-P option, iSQL first checks the isqlpassword variable. If no value is set, iSQL uses the default password (null ). The following example shows how to set the lpassword variable in the command prompt and then access the iSQL utility: C:/> set isqlpassword = abracadabrac:/> iSQL-e without asking for the password.
-S SERVER_NAME
Specify the default SQL server instance to connect. ISQL does not support connection to SQL Server 2000 named instances. If no server is specified, iSQL connects to the default instance of SQL server on the local computer. This option is required if you want to execute iSQL from a remote computer on the network.
-H wksta_name is the workstation name.
The workstation name is stored in sysprocesses. hostname and displayed by sp_who. If not specified, the current computer name is used.
-D db_name: A use db_name statement is issued when iSQL is started.
-L time_out specifies the number of seconds before iSQL logon times out.
If the time_out value is not specified, the command runs indefinitely. The default timeout value for logging on to iSQL is 8 seconds.
-T time_out specifies the number of seconds before the command times out.
If the time_out value is not specified, the command runs indefinitely. The default timeout value for logging on to iSQL is 8 seconds.
-H headers specifies the number of rows to be printed between column headers.
By default, the title is printed once for each query result set. Use-1 to specify that the title is not printed. If-1 is used, no space is allowed between the parameter and the setting.
(Can be-h-1, cannot be-h-1 ).
-S col_separator specifies the column delimiter, which is a space by default.
To use a character (for example, |; & <>) that has a special meaning on the operating system, use double quotation marks.
-W column_width allows you to set the screen output width. The default value is 80 characters. When the output row reaches the maximum screen width, it is split into multiple rows.
-A packet_size allows you to request data packets of different sizes.
The valid value of packet_size is between 512 and 65535. The default iSQL value in Microsoft Windows NT & reg; Is 8192; in addition, the default iSQL value in Microsoft MS-DOS & reg; is 512, but you can also request larger packets in this version. The increase in the packet size can improve the performance of large script execution. In such execution, the number of SQL statements between go commands is very important. Microsoft tests show that 8192 is the typical fastest setting for large-capacity replication operations. A larger data packet size can be requested, but if the request cannot be approved, iSQL is 512 by default.
-E echo input.
-X max_text_size specifies the maximum length of the returned text data, in bytes.
Text values longer than max_text_size are truncated. If max_text_size is not specified, text data is truncated at 4096 bytes.
-C termination _end specifies the command Terminator.
By default, the command is terminated by entering go in a single line and sent to SQL Server 2000. When the reset command ends, do not use the reserved characters or characters for the operating system with special meanings, regardless of whether there is a backslash before it.
-Q "query" executes the query When iSQL is started, but does not exit iSQL when the query is complete.
(Note that the query statement should not contain go ). If you issue a query from a batch file, use % variables. Environment % variables % is also available. For example:
Set table = sysobjectsisql/Q "select * from % table %" Double quotation marks the query and quotes any content embedded in the query.
-Q "query": executes the query and immediately exits iSQL when the query is complete.
Double quotation marks are used for the query, and any content embedded in the query is enclosed by single quotation marks.
-N: Delete the number and prompt symbol (>) from the input line ).
-M error_level: Display custom error information.
Displays the number, status, and error level of a specified or higher severity error. No information is displayed for errors with a severity level lower than the specified severity level. Use-1 to specify that all headers are returned together with messages, even information messages. If-1 is used, no space is allowed between the parameter and the setting.
(It Can Be-M-1, not-m-1 ).
-R {0 | 1} redirects the message output to the screen (stderr ).
If no parameter is specified or the specified parameter is 0, only 17 or higher error messages are redirected.
If the parameter is set to 1, all messages (including "print") will be redirected ").
-I input_file identifies the files that contain a batch of SQL statements or stored procedures. The less than (<) comparison operator can be used to replace-I.
-O output_file identifies the file that receives output from iSQL.
The greater than (>) comparison operator can be used to replace-o. -P print performance statistics.
-B indicates that iSQL exits when an error occurs and a DOS errorlevel value is returned.
When the SQL server error message severity level is 10 or higher, the value returned to the DOS errorlevel variable is 1; otherwise, the return value is 0. A MS-DOS batch file can test the DOS errorlevel value and handle errors as appropriate.
-O indicates that iSQL is restored to an earlier version. The following features are disabled: EOF batch processing console width auto-Adjusted Width Information
This option also sets the default value of DOS errorlevel to-1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.