SqlSetLHost%

Sets the workstation name in the SQL Server login record.

Syntax

SqlSetLHost% ( loginrec%, workstation$ )

where

loginrec% ( )
Is a login record. The value of loginrec% is returned by SqlLogin%.
workstation$
Is the workstation name sent to SQL Server. The string can have as many as 30 characters. SQL Server stores only the first 10 characters and ignores the rest.

Returns

SUCCEED (1) or FAIL (0).

Remarks

For SqlSetLHost% to have any effect, it must be called before SqlOpen%. SqlSetLHost% is optional. If SqlSetLHost% is not called, the workstation name is set to an empty string.

SQL Server uses the workstation name in its sysprocesses table and when you issue an sp_who procedure to identify your connection. You see the workstation name when you query the sysprocesses table in the master database.

See Also

SqlLogin%, SqlOpen%, SqlSetLApp%, SqlSetLPwd%, SqlSetLUser%