Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

SQL Server App_name() function - find out which application has modified your data

Jul 28 2010 4:14AM by Madhivanan   

Sometimes back, my friend told me that they had an application where users update their timesheets. He suspected that some users who had access to the database directly update some entries. He wanted to know whether some users update entries using a query analyser and not using the application. You can use a profiler for this.

Another method is to use app_name() function. App_name() function is used to return the name of the application from which data come. Consider the following example

declare @t table(
	userid int,
	timein datetime, 
	timeout datetime,
	source varchar(200) 
	default app_name()
)
insert into @t(userid,timein,timeout)
select 1001,'20100710 08:30:20','20100710 18:45:00'

select * from @t

The result is

userid timein              timeout             source
------ ------------------- ------------------- ------------------------
1001   2010-07-10 08:30:20 2010-07-10 18:45:00 Microsoft SQL Server 
                                               Management Studio - Query

As you see the source specifies that data are inserted from Query Analyser. If you have any front end application like VB6, and add data to the table,
the source would specify it as "Visual Basic". So app_name() is a quick way of knowing where data come from.

Tags: t-sql, sql_server, tsql, BRH, #TSQL, function, app_name(), #SQLServer,


Madhivanan
3 · 39% · 12441
2
 
0
Lifesaver
 
 
0
Learned
 
0
Incorrect



Submit

1  Comments  

  • True, this is really a nice function... keep it up Madhivanan!

    commented on Aug 5 2010 2:23AM
    Hemantgiri S. Goswami
    108 · 1% · 467

Your Comment


Sign Up or Login to post a comment.

"SQL Server App_name() function - find out which application has modified your data" rated 5 out of 5 by 2 readers
SQL Server App_name() function - find out which application has modified your data , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]