Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Returns the application name for the current session if set by the application.
Transact-SQL Syntax Conventions
Syntax
APP_NAME ( )
Return Types
nvarchar(128)
Examples
The following example checks whether the client application that initiated this process is a SQL Server Management Studio session.
USE AdventureWorks;
GO
DECLARE @CurrentApp varchar(40)
SET @CurrentApp = APP_NAME()
IF @CurrentApp <> 'SQL Server Management Studio - Query'
PRINT 'This process was not started by a SQL Server Management Studio query session.';
GO
See Also
Reference
System Functions (Transact-SQL)
Functions (Transact-SQL)