![]() | ![]() |
Home |
|
|
Transact-SQL User's Guide |
|
| Chapter 1 SQL Building Blocks |
|
| How to use Transact-SQL with the isql utility |
You can use Transact-SQL directly from the operating system with the standalone utility program isql.
You must first set up an account, or login, on Adaptive Server. To use isql, type a command similar to the following at your operating system prompt:
isql -Uhoratio -Ptallahassee -Shaze -w300
where "horatio" is the user, "tallahassee" is the password, and "haze" is the name of the Adaptive Server to which you are connecting. The -w parameter displays isql output at a width of 300 characters. Login names and passwords are case-sensitive.
If you start isql without using a login name, Adaptive Server assumes that your login name is the same as your operating system name. For details about specifying your server login name and other parameters for isql, see the Utility Programs manual for your platform.
Do not use the -P option to isql to specify your password, because another user might see your password.
After you start isql, you see:
1>
You can now start issuing Transact-SQL commands.
To connect to a non-Sybase database using Component Integration Services, use the connect to command. For more information, see the Component Integration Services User's Guide. See also connect to...disconnect in the Reference Manual.
When your Adaptive Server account was created, you may have been assigned a default database to which you are connected when you log in. For example, your default database might be pubs2, the sample database. If you were not assigned a default database, you are connected to the master database.
You can change your default database to any database that you have permission to use, or to any database that allows guests. Any user with an Adaptive Server login can be a guest. To change your default database, use sp_modifylogin, which is described in the Reference Manual.
To change to the pubs2 database, which is used for most examples in this manual, enter:
1> use pubs2 2> go
Enter the word "go" on a line by itself and do not precede it with blanks or tabs. It is the command terminator; it lets Adaptive Server know that you have finished typing, and you are ready for your command to be executed.
In general, examples of Transact-SQL statements shown in this manual do not include the line prompts used by the isql utility, nor do they include the terminator go.
You can specify the -V option of isql to use network-based security services such as unified login. With unified login, you can be authenticated with a security mechanism offered by a third-party provider and then log in to Adaptive Server without specifying a login name or a password. Other security services you can use, if they are supported by the third-party security mechanism, include:
Data confidentiality
Data integrity
Mutual authentication
Data origin checking
Data replay detection
Out-of-sequence detection
See the System Administration Guide for more information about the options you can specify to use network-based security.
You can log out of isql at any time by typing:
quit
or
exit
Either of these commands returns you to the operating system prompt, and do not require the terminator "go".
For more details on isql, see the Utility Guide.
|
|