APP_NAME (T-SQL)

Returns the application name for the current session if one has been set by the application.

Syntax

APP_NAME()

Return Types

nvarchar(128)

Examples

This example checks whether the client application that initiated this process is a SQL Server Query Analyzer session.

DECLARE @CurrentApp varchar(35)

SET @CurrentApp = APP_NAME()

IF @CurrentApp <> 'MS SQL Server Query Analyzer'

PRINT 'This process was not started by a SQL Server Query Analyzer query session.'

  

See Also

System Functions

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.