Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: All
Jun 16, 1999

Return the Program Name for the Current Session in SQL Server

SQL Server 6.5 has an APP_NAME() function which returns the program name for the current session. This function is useful for tracking which client applications are running processes in SQL Server or for limiting access to specific applications. This built-in function returns the program name for the current session if the program has set one. The value returned must have a char or varchar datatype and can be a maximum length of 30 characters. This example checks that the client application that initiated this process is the correct one:
 
DECLARE @ThisApp varchar(30)
SELECT @ThisApp = APP_NAME()
IF @ThisApp <> 'App3'Log
PRINT "This process was not started with the current version of the Log program"
Jai Bardhan
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap